Force https and www using htaccess

To force a website domain with https and www, simply add this line to your www root htaccess file

RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www\.domain\.com$ [NC]
RewriteRule ^(.*)$ https://www.domain.com/$1 [L,R=301]
Tagged: Tags:

Leave A Comment?