Reputation: 29
I am using this to redirect all requests for http pages to https. However, I need to exclude certain pages on the site that must remain http. I am at a loss how to do this. RewriteEngine On RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://www.reny.net/$1 [R,L]
Upvotes: 0
Views: 71
Reputation: 5129
Use RewriteCond
to check %{REQUEST_URI}
before the RewriteRule
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteCond %{REQUEST_URI} !^(/page1|/page2)$
RewriteRule ^(.*)$ https://www.reny.net/$1 [R,L]
Upvotes: 0