Live data from Hacker News

301 redirects: a dangerous one way street (2012)

jacquesmattheij.com

71–80 of 92 posts

Re: 301 redirects: a dangerous one way street (2012)

#72
post #7

I took over a domain which had previously 301-redirected HTTP:// to HTTPS://. It caused us no end of trouble getting the alpha site online -- obviously we set up SSL but we didn't realise it was the _first thing we'd have to do_. It 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…

This was probably HSTS not a 301. HSTS headers include a validity, but 1yr is common. Good luck convince anyone to undo this, clearing cache does help and you need to dive into your browser internals for a fix: chrome://net-internals/#hsts

https://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security

Re: 301 redirects: a dangerous one way street (2012)

#73
If the owner of the domain had done it, would it still really be an "eternal issue" since:

a. most popular websites nowadays are so bloated that browser caches would throw out many things (including your tiny site that someone checks a few times a week or even longer) a lot sooner compared to how things were about 10 years ago (I presume the default disk cache sizes in browsers have not increased by multiples in this period).

b. more people are browsing through mobile devices that are dumped in a few years and replaced with a new one, new browser, empty cache, etc.

Re: 301 redirects: a dangerous one way street (2012)

#74
post #66

I saw this article at approximately the same time as I saw this tweet: https://twitter.com/P0TUSTrump/status/684891719985410048 . --- begin factually incorrect statement --- To save you a click: Jeb Bush forgot to renew his domain, and Trump bought it and redirected to www.donaldjtrump.com Thankfully, Trump is using a 302, not a 301. --- end factually incorrect statement --- EDIT: ah I see -- jebbush.com has only eve…

Jeb Bush or his organisation never owned it and did not forget to renew it.

Re: 301 redirects: a dangerous one way street (2012)

#75
post #14

That's what permanent means. "Adjective permanent Without end, eternal. Lasting for an indefinitely long time. " Also, "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.

This seems yet another example of web professionals not understanding HTTP. Much like webpages that say "404 not found" with a "200 OK" header.

Is the status line technically a header?

Re: 301 redirects: a dangerous one way street (2012)

#76

The 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…

I think that when you clear the cache on recent versions of Chrome it also removes 301 redirects. I'm not sure though.

That fixes the problem for you as a web client, but not you as a domain owner. Everyone who visited it during the 301 will continue to treat it as such until they clear their cache (or equivalent).

Re: 301 redirects: a dangerous one way street (2012)

#77
post #19

2012 - somebody should write 2012 into the title of this post (that by the way hasn't any concrete data) I did some testing in 2009, think around 2012 and 2014. Additional to loffilegrepping after some big site URL rewrites. It's a non issue. No caching headers, the redirect gets cached only for the current browser session. Close it, reopen it, gone, done. Lets discuss this one based on data. (Which I cant provide ri…

Are you sure you tested with a 301 redirect (with no caching headers) and not 302 or one of the others? I've been bit by 301s personally.

Re: 301 redirects: a dangerous one way street (2012)

#78
post #50

The 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…

Not only that, anybody with a WiFi Pineapple or any other MITM could 301 redirect anything you visit without HTTPS to their spam site. 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?

As a developer, I would definitely consider it unintended behavior if a browser interprets "Page Moved Permanently" to mean "URL Permanently Discontinued".

Re: 301 redirects: a dangerous one way street (2012)

#79
post #34

It's easy to live your life to keep Google happy. 301 redirects have been an important part of online website life. But then I do accept this perspective (if it's within your call to take this risk). Just don't 301-redirect it. Let the search engines figure it out for themselves. If a user has a bookmark to an old resource, then it's a liability for you to try to keep your web of 301s working. KISS!

I would say links are a bigger problem than bookmarks. For instance stack overflow answer links to apple or msdn references, are really annoying if they die.
Post reply on HN