I run a small bootstrap themes site that allows users to upload themes and templates.
I've been able to redirect any non SSL connection to https via my .htaccess file with the following:
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
I now need to redirect the user to non-SSL for one page in particular. It's a page containing an iframe that loads a preview from the theme authors site and these sites aren't always served via SSL.
The URL always has the word 'preview' preceded by the domin.
Here's is what I've tried, unfortunately without success:
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} !^/preview [NC]
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTPS} on
RewriteCond %{REQUEST_URI} ^/preview [NC]
RewriteRule ^ http://%{HTTP_HOST}%{REQUEST_URI} [NC,L,R]
Here are two examples:
non-preview link: http://www.bootstrapcovers.com/bootstrap-themes/all/free/sort.downloads/page.1
preview link http://www.bootstrapcovers.com/preview/1/adminlte-admin-control-panel
Any idea why it's not working or what I'm missing from the .htaccess file?
Thanks, -Paul