Forcing HTTPS using .htaccess

In order to force HTTPS to all web traffic, insert the following code into your .htaccess file in the root directory of your domain.

RewriteEngine On 
RewriteCond %{SERVER_PORT} 80 
RewriteRule ^(.*)$ https://www.example.com/$1 [R,L]