Forum Moderators: phranque
I have DomainA and DomainB. I didn't have a website configured for DomainB so Apache was serving up DomainA content when someone had requested DomainB.
I discovered this recently after finding that DomainB was thoroughly indexed by Google and had the same page rank as DomainA.
I figured the best solution would be to setup a redirect for DomainB:
Redirect 301 / [DomainA...]
This works great in seamlessly redirecting all requests without throwing up 404 pages and such, but I just want to make sure that this indeed is the best way to go in terms not getting punished by Google, loosing page rank, etc.
thanks much in advance, -Alain.
Either approach will prevent a duplicate-content issue, caused by splitting your PageRank/Link-popularity across two (or more) domains.
Other things to look out for (and to correct if present) are subdomain and page canonicalization problems. Test the following, and correct them (with a 301 redirect) if they return the same content:
domainA/
www.domainA/
domainA/index.php (or .html, .asp -- whatever you might use)
www.domainA/index.php
All should redirect to either www.domainA or to domainA, whichever you choose based on current linking, ranking, and personal preference. In order to correct these problems, you'll need to use mod_rewrite on domainA itself, examining the HTTP_HOST and REQUEST_URI server variables. Apache mod_alias (the Redirect directives) cannot test these variables, and so cannot be used to fix these problems)
Jim