301 Redirect vs DNS change: Is it ever safe to kill a 301 redirect and update the DNS for a subdomain?

末鹿安然 提交于 2019-12-01 08:36:39

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.)

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.

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!