Luutaa Technologies - Developer Blog

Force SSL using htaccess file

Many times on pages which process secure information such as login or checkout, we need to use SSL and to make sure every user uses SSL only, we can force SSL.

Most of the Payment Gateway service require payment information to be processed & sent using only by SSL otherwise they can hold your funds. Worst case if by any chance credit card information is leaked because of incorrect setup, they may fine you as much as $10,000 to $25,000.

Here’s a quick way to make sure the pages you want on SSL uses SSL ONLY.  In .htaccess file put these lines.

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

Leave a Reply:

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