301 redirects: a dangerous one way street (2012)
jacquesmattheij.com
301 redirects: a dangerous one way street (2012)
1–10 of 92 posts
Re: 301 redirects: a dangerous one way street (2012)
#2Also, "This response is cacheable unless indicated otherwise," says RFC 2616.
Working as designed, IMNSHO. Perhaps not working as intended, but alas, that's a case of ¬RTFM.
Re: 301 redirects: a dangerous one way street (2012)
#3You often can't use 302 because all your external links no longer work SEO magic for you with a 302. Google only transfers link juice with 301 [1].
If you make a mistake and misconfigure your server, you're toast.
If a disgruntled employee 301 redirects your domain, you're toast.
If a service provider misconfigures your domain, you're toast.
If a hacker (from a competitor) 301 redirects your domain, you're toast.
If you buy a domain that had a 301 on it, it's worthless.
If you buy a domain that had 301s on it that point to phishing sites, you're in trouble.
I always add cache headers to 301 redirects I use to at least prevent me from shooting myself with an arrow in my knee.
UPDATE: [1] Google seems to have changed this recently. It also no longer considers http/https different pages as it did in the past with the same content https://www.searchenginejournal.com/google-confirms-no-loss-...
Re: 301 redirects: a dangerous one way street (2012)
#4Re: 301 redirects: a dangerous one way street (2012)
#5I guess some people think the purpose of 301 is more like that of 410: update references so you don't try to go there again. The difference is that with 301 you additionally instruct the client to not even attempt to go there again in the future.
But the article does raise an interesting point: if I own somedomain.example and set it up with a 301 redirect to myotherdomain.example and enough people visit it that most people will have cached the redirect, doesn't that basically mean I now own it for perpetuity (or until enough people have cleared their cache) even if I don't renew the domain and new requests to the domain are no longer served (by the same IP)?
Or do browsers have some kind of protections against this, at least based on DNS? It's a bit too convoluted for a proper DOS attack (because you need to own the domain long enough and make it popular enough to poison everyone's caches) but a naive implementation seems like it would effectively render domains unusable if someone set up a 301 on them at some point in the past.
Re: 301 redirects: a dangerous one way street (2012)
#6HSTS is similarly one-way, but it's not indefinite, I think.
Re: 301 redirects: a dangerous one way street (2012)
#7It also caused half a day of confusion to understand why some of our web browsers were still failing to connect and others could see the alpha site (because they'd never visited the previous 301 site at that address).
Re: 301 redirects: a dangerous one way street (2012)
#8It would have been useful to include those headers in the blog post.
Re: 301 redirects: a dangerous one way street (2012)
#9The problem with 301 without cache headers is that some browsers cache this forever due to some interpretation what 'permanent' means. You often can't use 302 because all your external links no longer work SEO magic for you with a 302. Google only transfers link juice with 301 [1]. If you make a mistake and misconfigure your server, you're toast. If a disgruntled employee 301 redirects your domain, you're toast. If a…
Re: 301 redirects: a dangerous one way street (2012)
#10> You can improve a bit on this by sending along a bunch of cache control headers to at least limit the damage. It would have been useful to include those headers in the blog post.
Last-Modified: Fri, 19 Feb 2016 12:54:49 +0100
Expires: Sun, 29 May 2016 12:54:49 +0200
Cache-Control: max-age=8640000, must-revalidate
See also: https://www.mnot.net/cache_docs/#CONTROL