Hi, all! This morning Im playing around with my .htaccess file trying to force http on all parts of my site EXCEPT a folder called /docs. I know how to force https for /docs, but I dont want to force https. I want the visitor to be able to use http OR https, so in the code below, its forcing http for all parts of my site. What Im trying to figure out is what to add to make an exception for the /docs folder. If someone could hep me out, Id really appreciate it. #Force http for everything RewriteEngine On RewriteCond %{HTTPS} on RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} Code (markup): Thanks.
Are there any other rewrites going on for the docs folder ? The simple solution would be to turn off the RewriteEngine in the docs folders htaccess.
Hey... a fellow Floridian! Yeah, in the /docs folder if I put this in an .htaccess file, it will force https for just this folder: RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} Code (markup): EXCEPT..... dang. I just realized that ONE file within this folder does not function properly under https, so I need to make an exception for just one file in this folder to be displayed as http...
Just add this condition, and replace Folder1 folder2 folder3 with your folder names. Cheers RewriteCond %{REQUEST_URI} !^/(Folder1|Folder2|Folder3) Code (markup):
It is almost always better to use a subfolders htaccess than it is to use RewriteCond in a parent folder. If you want to know why, enable RewriteLog on a test server withh fully detailed logging and take a look at the process the RewriteEngine goes through.