kodie
9/25/2015 - 6:35 PM

Force HTTPS and WWW in htaccess

Force HTTPS and WWW in htaccess

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteEngine On
RewriteBase /

#Force HTTPS
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI}/$1 [R=301,L]

#Force WWW
RewriteCond %{HTTP_HOST} ^brookslodden\.com [NC]
RewriteRule ^(.*)$ https://www.brookslodden.com/$1 [L,R=301,NC]
</IfModule>