Quick Tip – Force SSL with .htaccess

Quick way to force SSL ( https:// ) by using .htaccess. Edit your .htaccess and add the following:

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Published by Janes Oosthuizen

Programmer and Tech Junky from Bloemfontein, South-Africa. I have been programming for 8 years in various languages including ( CSS, HTML, jQuery, PHP, MySQL, Wordpress and many other ).

Leave a comment

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