I am trying to get a couple of directories to always be https and everything else be http
With the exception of images, css files and js files which should be on whatever the page is on.
So I created this htaccess rewrite:
RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} ^www\. RewriteRule ^(.*)$ https://server.com/$1 [R=301,L] RewriteCond %{HTTP:X-Forwarded-Proto} !https RewriteRule ^login/(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] RewriteRule \.(gif|jpe?g|png|css|js)$ - [NC,L] RewriteCond %{HTTP:X-Forwarded-Proto} https RewriteCond %{REQUEST_URI} !^login/(.*)$ RewriteRule .* http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] But when I go to /login I get an error
Firefox has detected that the server is redirecting the request for this address in a way that will never complete. What needs to change for this to work properly?
%{HTTP:X-Forwarded-Proto}supported on your Apache?