Skip to content

Force SSL using htaccess

Last updated on January 17, 2018

Forcing visitors to use SSL can be accomplished through your .htaccess file using mod_rewrite module. we have to force browsers to use secure connection only for sensitive pages like checkout, login pages..etc.

Most of the payment gateways require SSL connection to processed and sent transactions otherwise they just hold the transaction.

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]
0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments