How to force https using .htaccess? Print

  • 0

In order to force https for all your pages you need to add the following lines to your .htaccess file:

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

You need to change example.com to your own domain name.

Was this answer helpful?

« Back