Created
June 27, 2013 21:09
-
-
Save vdite/5880425 to your computer and use it in GitHub Desktop.
Redirect an old domain and all the old sites to a new domain
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
#this redirects all your old stuff to the main site of the new domain | |
RewriteEngine on | |
RewriteCond %{HTTP_HOST} ^old-domain.com [NC] | |
RewriteRule ^(.*)$ http://new-domain.com/ [L,R=301] | |
RewriteCond %{HTTP_HOST} ^www.old-domain.com [NC] | |
RewriteRule ^(.*)$ http://new-domain.com/ [L,R=301] | |
#this redirects all your old stuff to the new domain, leaving all deep urls like before | |
RewriteEngine on | |
RewriteCond %{HTTP_HOST} ^old-domain.com [NC] | |
RewriteRule ^(.*)$ http://new-domain.com/$1 [L,R=301] | |
RewriteCond %{HTTP_HOST} ^www.old-domain.com [NC] | |
RewriteRule ^(.*)$ http://new-domain.com/$1 [L,R=301] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment