views:

1208

answers:

3

I have a site running at a subdomain that has been migrated to a new server and new domain name. To preserve search credits I know a 301 redirect is the proper way to handle migrating the transition. (The marketing department speaks of 301 redirects like I've never heard of.)

From a technical standpoint, I don't understand how long you have to maintain a redirect. Can someone explain this? It seems like extra and unnecessary load on a server to keep a redirect running indefinitely. Do you eventually drop it or make it a DNS change after the search engines have stopped linking to the previous site?

+2  A: 

There's only load on the server (and minuscule at that) if someone actually uses the redirect, so there's no sense removing it and missing out on even one hit from an old link.

ceejayoz
Surely that depends if it's a simple Redirect directive or a more complex, possibly compound, Rewrite directive. As far as I know each rewrite directive tries a regex match on every incoming page request regardless of whether it's used or not so that's some load right there. I agree it's never likely to add up to much though.
+1  A: 

You can make the DNS record for the subdomain a CNAME record referencing the new domain; I don't think there's any harm in doing so, as long as the site still works (some web applications depend on knowing the domain name they're accessed with). However, people who navigate to the subdomain will actually see the subdomain, not the new domain, in their browsers' address bars, so they won't know the site has switched domains. For that reason I would not use a CNAME record to do a "redirect" like that. I'd stick with the HTTP 301 redirect.

Now, I agree with ceejayoz that the load on the server is negligible, so there's no need to remove the 301 redirect. But if you did want to know how soon you can remove it - for instance if you wanted to reuse that subdomain for a different site - I would look at your server's access logs to track the number of hits on the subdomain over time, after the new site goes live. (If you have a logfile analyzer installed, it makes this easy) If a (week|month|year) passes without you getting any requests for anything on that subdomain, it's a sign that the redirect may not be needed anymore. Obviously, the longer you wait without getting any requests on the subdomain, the more likely it is that the redirect can be safely removed.

David Zaslavsky
A: 

301 is "Moved Permanently" so, in theory, search engines and browsers which have the link in their bookmarks should switch to the new URL. But I wouldn't bet that everyone does it. So, I agree with ceejayoz, it is prudent to keep the old URL working forever.

(Remember also that URL are not only stored in search engines, you can find them in many places, even on paper. That's why URLs never die. Think twice before publishing an URL, you'll never be able to recall it afterwards.)

bortzmeyer