Forcing a site to HTTPS using .htaccess

Occasionally you may want a site to be fully https.

Especially since Google recently said that they may prefer HTTPS sites as getting a certificate is a costly exercise so spammers are less likely to adopt SSL.

Within .htaccess the code is as follows

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

 

 


Posted

in

, ,

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *