We have a domain we wish to redirect to another one. What is is the best way to transfer to pagerank to the other domain?
phranque
5:24 am on Mar 5, 2013 (gmt 0)
301 status code on the response.
one-to-one correspondence between legacy urls and new urls for the redirects. (no "wildcard" redirects to the home page.) in other words redirect the old home page only to the new domain and 404/410 all other requests; or, redirect requests for a specific set of legacy urls to the equivalent urls on the new domain and 404/410 all requests for "junk" urls.
whatson
6:45 pm on Mar 5, 2013 (gmt 0)
ok, so do I do that in the htaccess file?
phranque
7:03 pm on Mar 5, 2013 (gmt 0)
if you can translate the old urls to the new urls using a translation table or using patterns and well-defined rules with possible exceptions, you can use mod-rewrite directives in the .htaccess file.
if the url translation requires a database lookup then you will need to internally rewrite the old urls to a script that provides the proper response. the internal rewrite will also require some mod_rewrite code in the .htaccess file. it will be helpful if you can distinguish old urls from new urls for this internal rewrite.
anything more specific than that requires more information about what your urls look like.
whatson
9:28 pm on Mar 5, 2013 (gmt 0)
Actually what I want to do is catch any url from this domain, and redirect it to the homepage of the new url. Is there some catch all redirect?
swa66
10:02 pm on Mar 5, 2013 (gmt 0)
Actually what I want to do is catch any url from this domain, and redirect it to the homepage of the new url. Is there some catch all redirect?
This raises the question: Is then there no content on your new domain to satisfy the vistors on the old urls ?
I put it harsh, cause that's also what you'd be doing to visitors that end up on deep links and it's also the signal you send to search engines.
lucy24
11:09 pm on Mar 5, 2013 (gmt 0)
Is there some catch all redirect?
Yes, it's trivial. A single line in htaccess. In some shared-hosting setups you can even do it by clicking a button somewhere in your control panel.
What people are trying to find out is whether you are absolutely positive you want to do this, and are making an informed choice. Eventually we get to the "Awright, just show him how to aim the ### gun" part, but not yet.
phranque
12:31 am on Mar 6, 2013 (gmt 0)
that part where I said "no wildcard redirects to the home page".
you probably don't want to do that to your visitors. the proper response is a 404 (or 410 if appropriate) status code. then provide a custom error document that looks similar to your new domain's home page with sufficient navigation and/or search capability for the visitor to find the resource they were expecting when they clicked on the linked to or bookmarked url on the old domain.
if you try to redirect all the pagerank from the old domain the the new domain's home page you will likely lose most or all if it.