How can I redirect all pages to https, using .htaccess, with exceptions?
.htaccess, apache, php, redirect, ssl
Solution
You're already part way there with your use of `RewriteCond` to restrict the rewrites to requests on port 80.
You do not want to rewrite requests on port 80 for `/videos` and `/blog`, so:
RewriteCond %{SERVER_PORT} 80
RewriteCond %{REQUEST_URI} !^/videos
RewriteCond %{REQUEST_URI} !^/blog
RewriteRule ^(.*)$ https://ourdomain.com/$1 [R,L]
And you want to rewrite requests for these URLs on port (presumably) 443:
RewriteCond %{SERVER_PORT} 443
RewriteRule ^/((videos|blog)/.*) http://ourdomain.com/$1 [R,L]
Problem
I have used htaccess to force all pages to re route to https using... ``` RewriteEngine on RewriteBase / RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://ourdomain.com/$1 [R,L] ``` Is there any way I can reverse that rule for ourdomain.com/videos && ourdomain.com/blog making sure that these pages are forced to drop the https and use http?