Redirect site to HTTPS excluding a folder
On a web site, customer need to redirect all pages to HTTPS, but want to keep files in one of the folder on HTTP.
For this, i used following in .htaccess file.
1 2 3 4 |
RewriteEngine On RewriteCond %{HTTPS} off RewriteCond %{REQUEST_URI} !^/auth/.* RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] |
Here any url like yourdomain.extn/auth/ will not get redirected to HTTPS.
See Redirect