Force all visitors to a website to use the SSL enabled version or https://
While building a financial site, there was a requirement to force all visitors to use the SSL enabled version of the site.
This is a common enough requirement and can be accomplished easily using .htaccess.
Just add the following to a .htaccess file and place it in your website’s root folder. Replace www.domain.com with your domain.
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.domain.com/$1 [R,L]