htaccess force https

20.Jul.2010

To have your website going through secure connection, you can use htaccess redirect. You can redirect all visits from that are not going through https, and force your website to use secure connection by using only htaccess. Us following htaccess snippet to force https.

1
2
3
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}