Remove SSL integration from a specific folder using .htaccess

Just add a condition to exclude the folder:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} !^/folder
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

And if you wanted to redirect SSL requests to non-SSL forĀ /folder, then:

RewriteCond %{HTTPS} on
RewriteCond %{REQUEST_URI} ^/folder
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Leave a Reply

Your email address will not be published. Required fields are marked *