Home > Apache > Force all visitors to a website to use the SSL enabled version or https://
Bookmark and Share

Force all visitors to a website to use the SSL enabled version or https://

Posted on August 02, 2013 | Filed in Apache, Featured, Security, The Web

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]

Leave a Reply