by _Codemonkeyism · 10y ago · 0 comments
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 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-...
It seems like browsers interpreting permanent as forever is some kind of a bug. Even if that's literally what it says, that's not what anybody wants. What great evil is being prevented by not having it expire and be refreshed after 45 days?
Reminds me of the guy that "got hold" of Google's domain for a few minutes. What if something similar happened and someone were able to make this redirect? Millions would be affected.
http://mark.koli.ch/set-cache-control-and-expires-headers-on...