Force HTTPS using .htaccess
As mentioned in a previous article, Google announced in their blog that it will start favoring websites that use HTTPS. Google ranking and increased security for your users is two major reasons why you should consider getting an SSL certificate and moving your website to HTTPS.
If you are using an Apache web server you can use the snippet below in your .htaccess file in order to redirect all HTTP requests to HTTPS.
1 2 3 4 | RewriteEngine On RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] |
Leave a Reply