Created
February 22, 2014 15:29
-
-
Save Shaz3e/9156616 to your computer and use it in GitHub Desktop.
This file contains 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
# add www to any url | |
RewriteEngine on | |
RewriteCond %{HTTP_HOST} !^www\.domain\.com [NC] | |
RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301] | |
# remove www from any url | |
Options +FollowSymlinks | |
RewriteEngine on | |
RewriteCond %{HTTP_HOST} ^www\.domain\.com [NC] | |
RewriteRule ^(.*)$ http://domain.com/$1 [L,R=301] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment