Last active
February 3, 2018 03:08
-
-
Save davidsword/911630c964456fca18a0fcdb3b0ba0b2 to your computer and use it in GitHub Desktop.
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
# Redirect non-www urls to www | |
RewriteEngine on | |
RewriteCond %{HTTP_HOST} !^www\.yoursite\.com/$ | |
RewriteRule (.*) http://www.yoursite.com/$1 [R=301,L] | |
# Redirect www urls to non-www | |
RewriteEngine on | |
RewriteCond %{HTTP_HOST} ^www\.yoursite\.com$ | |
RewriteRule ^(.*)$ http://yoursite.com/$1 [R=301,L] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment