Code: Select all
RewriteCond %{HTTPS} off
# Don't put www. here. If it is already there it will be included, if not the subsequent rule will catch it.
Code: Select all
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Code: Select all
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Code: Select all
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>