old domain link:
http://www.old.com/aa/bb/cc.html
i want when this old link to be visiting,turn to:
http://www.new.com/aa/bb/cc.html
how to do this?
BTW: nginx or apache
old domain link:
http://www.old.com/aa/bb/cc.html
i want when this old link to be visiting,turn to:
http://www.new.com/aa/bb/cc.html
how to do this?
BTW: nginx or apache
Create a .htaccess file similar to the following and place it to the old domain root directory.
RewriteEngine On
RewriteRule ^(.*)$ http://www.new.com/$1 [R=301,QSA]
For nginx I go with this on account that it also helps with alias domains.
if ($host != 'www.new.com' ) {
rewrite ^/(.*)$ http://www.new.com/$1 permanent;
}