Created
September 2, 2012 04:20
-
-
Save crystalw/3594819 to your computer and use it in GitHub Desktop.
.htaccess preferred domain redirect
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
| # 301 direct to preferred domain | |
| RewriteEngine On | |
| RewriteBase / | |
| RewriteCond %{HTTP_HOST} !^yourdomain.com$ [NC] | |
| RewriteRule ^(.*)$ http://yourdomain.com/$1 [L,R=301] | |
| # End 301 direct |
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
| # 301 direct to preferred domain | |
| RewriteEngine On | |
| RewriteBase / | |
| RewriteCond %{HTTP_HOST} !^www.domain.com$ [NC] | |
| RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301] | |
| # End 301 direct |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment