Old domain to New domain Redirection (htaccess redirect):
To redirect all the directories and pages of your old domain to your new domain, create a .htaccess file, which needs to be placed in the root directory of your old website (i.e the same directory where your index file is placed) . Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L]
www.newdomain.com in the above code must be replaced with your actual domain name.
Redirect to www (htaccess redirect)
To redirect all requests coming in to domain.com to www.domain.com create a .htaccess file with the below code.The .htaccess file needs to be placed in the root directory of your old website (i.e the same directory where your index file is placed)
Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^domain.com [nc]
rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,nc]
domain.com and www.newdomain.com in the above code must be replaced with your actual domain name.
Note* This .htaccess method of redirection works ONLY on Linux servers having the Apache Mod-Rewrite moduled enabled.
====================================================
There are other redirection methods, but this are the most sensetive redirections in the SEO perpose.
No comments:
Post a Comment