I have seen several questions about 301 redirects from one domain to another. This question refers to something of a special situation.
I have a website domain1.com which is points to /public_html/sitehosting
For several reasons, which I won’t get into now, we have decided to move the site to a new domain domain2.com which is also mapped to /public_html/sitehosting
How can I create a 301 redirect so that all domain1.com URLs are redirected to exactly similar URLs on domain2.com?
We would like this redirect so as to preserve Google PR juice…domain1.com has a pretty good pagerank. When domain1.com expires in about 6 months, we don’t plan to renew it.
P.S. I’m using WordPress with “seo” permalinks.
P.P.S. I understand that because both domains are mapped to the same folder, so any domain1.com URL will lead to the same content. But will PR juice be transferred to domain2.com this way?
Put this code in your
.htaccess
underDOCUMENT_ROOT
directory before your regular wordpress code: