Sitewide Htaccess Directive with SSL

Avatar
  • Answered
My vps site has comodo ssl working and I'm using the sitewide htaccess directive. What directives should I use to keep the root folder and other subdirectories ssl secure but allow one subdirectory (folder1) to be http or non-ssl?
Avatar
anonymous
Hello, Thank you for your question regarding your sitewide .htaccess directive with SSL. You should be able to use something like this directive. RewriteEngine On RewriteCond %{HTTPS} off RewriteCond %{REQUEST_URI} !sub-folder [NC] RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] This should force HTTPS except for the folder called sub-folder. Best Regards, TJ Edens