How to force SSL with htaccess With this code i get a redirect error in chrome:
RewriteEngine On
RewriteCond %{HTTPS} !^on$ [NC]
RewriteRule . https://%{HTTP_HOST}/%{REQUEST_URI} [L] HTTPS_HOST ???
Thanks
How to force SSL with htaccess With this code i get a redirect error in chrome:
RewriteEngine On
RewriteCond %{HTTPS} !^on$ [NC]
RewriteRule . https://%{HTTP_HOST}/%{REQUEST_URI} [L] HTTPS_HOST ???
Thanks
You can use that:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [NE,L,R=301]
I suggest you use this code and its working fine
#Force SSL
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}