Last active
September 23, 2018 15:05
-
-
Save janus57/613f60aa0699cf3ff4567ddc8172b8c0 to your computer and use it in GitHub Desktop.
www or none ? That is the question
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Rewrite engine => "Power ON" | |
RewriteEngine On | |
RewriteBase / | |
# Force non-www | |
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC] | |
RewriteRule ^(.*)$ https://%1/$1 [R=301,L] | |
# Force www | |
RewriteCond %{HTTP_HOST} !^www\. [NC] | |
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment