1 2 3 4 5 6 7 8 |
# BEGIN Redirect www to non-www # <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC] RewriteRule ^(.*)$ http://%1/$1 [R=301,L] # </IfModule> # END Redirect non-www to www |
1 2 3 4 5 6 7 8 |
# BEGIN Redirect www to non-www # <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC] RewriteRule ^(.*)$ http://%1/$1 [R=301,L] # </IfModule> # END Redirect non-www to www |
1 2 3 4 5 6 7 |
# BEGIN Redirect non-www to www # <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTP_HOST} !^www\. RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] # </IfModule> # END Redirect non-www to www |
1 2 3 4 5 6 7 |
# Begin Force https <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R,L] </IfModule> # END Froce https |