Last active
April 12, 2016 06:15
-
-
Save fernandiez/9ee97de71a266dceb737c16fb9bb495a to your computer and use it in GitHub Desktop.
Change domain URLs from old to new domain .htaccess
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
# Change domain URLs from old to new domain (both domains parked on top of the same hosting) | |
# With www or without www | |
<IfModule mod_rewrite.c> | |
RewriteEngine on | |
RewriteCond %{HTTP_HOST} ^www.olddomain.com$ [OR] | |
RewriteCond %{HTTP_HOST} ^olddomain.com$ | |
RewriteRule ^(.*)$ http://www.newdomain.com/$1 [R=301,L] | |
</IfModule> | |
# Change domain URLs from old to new domain (both domains parked on top of the same hosting) | |
# Only with www | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteCond %{HTTP_HOST} ^www.olddomain.com$ | |
RewriteRule (.*)$ http://www.newdomain.com/$1 [R=301,L] | |
</IfModule> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment