News for hackers. Stuff that matters.
Re:Make your 404s into 302s by fizzizist1 on Friday May 29, 2020 @08:26AM (#23349137)
404s are useful though.. how annoying would it be if you wanted to get to a specific part of the site, and you kept getting redirected to somewhere else without being informed that the part you are trying to access doesn't actually exist. 4 errors exist for a reason.
Re:Make your 404s into 302s by davnicwil on Friday May 29, 2020 @08:39AM (#23349233)
This is right - 404 pages are the right UX when you have a 'stateful' resource that can be deleted, and you need to show that the URL (or ID param within) is correct, and once pointed to a resource, but now that resource has been permanently deleted and can't be shown any more.

In a sense this information conveyed by the 404 page is now the immutable 'resource' that will stay permanently at that URL. Doing a redirect breaks this, it's lossy and usually a bad UX.

Re:Make your 404s into 302s by hamilyon2 on Friday May 29, 2020 @08:41AM (#23349258)
"Was here but deleted" has its' own http code now, that is 410 AFAIK.
Re:Make your 404s into 302s by throwanem on Friday May 29, 2020 @08:48AM (#23349310)
Has had since 1997 at least, cf. https://tools.ietf.org/html/rfc2068 - it's just that nobody uses it.
Re:Make your 404s into 302s by OJFord on Friday May 29, 2020 @09:27AM (#23349714)
It's used in APIs, just not user-facing documents (or rather would-be documents). Too late for that though, while laymen pretty much get '404', introducing a subtly different numeric code to co-exist would be a bit much, I think. And also pretty worthless, anecdotally I think actually displaying big '404' text is on a downward trend, probably because of the prevalence of SPAs/webapps in general.
Re:Make your 404s into 302s by throwanem on Friday May 29, 2020 @09:45AM (#23349897)
Yeah, I mean, for the lay public to have to know what "404" means feels like a side effect of the early web being a frontier. What's important to tell the user is "there's nothing here", and that can and should be done without invoking any magic numbers at all.
Re:Make your 404s into 302s by davnicwil on Friday May 29, 2020 @08:54AM (#23349352)
A super useful distinction for APIs for similar reasons. Interesting these statuses are often remapped for the web, where a 410 is often implemented as a 404 like in the scenario I describe and the 'true' 404 is often implemented as a 302.
Re:Make your 404s into 302s by rakoo on Friday May 29, 2020 @09:27AM (#23349720)
Quite the contrary: if the _resource_ still exists but in the older site, the redirection will point the browser to the other location. OP's stratagem is doing exactly what it's supposed to do (if the identifier of a page is its path and not the full URL of course)
Re:Make your 404s into 302s by Etheryte on Friday May 29, 2020 @08:59AM (#23349380)
The subpage called "How"[1] covers this though. The idea is to redirect you through all the historical versions and then to a 404 if no match is found on any of them.

> www → 2017 → 1997 → Show 404 error

[1] https://4042302.org/how/

Re:Make your 404s into 302s by woodrowbarlow on Friday May 29, 2020 @11:19AM (#23350953)
doesn't this mean when they end up on your 1997 site (without realizing it, because all they did was click a link), and then try to navigate around, they're stuck in the old version of your site?

edit: maybe not, because the old site was written to assume it's running at the current site's subdomain? i guess it depends on much you've changed your URL structure since then. that thought makes me a little squeemish.

it seems like a nice approach would be to return the 404, and make your 404 page render a link that says "try an archived version?". you gotta let the user know that what they're about to see might be stale.

Re:Make your 404s into 302s by grifball on Friday May 29, 2020 @12:02PM (#23351610)
Yeah. I really like this idea of warning the user. Keep the usability without losing the functionality.

Also, not sure if anyone is thinking of this, but there are security concerns if you were to serve up old pages on a new domain. If that old page has a vulnerability, it now has access to data in the new domain. This is more for archiving, so the old pages wont get patched.

Re:Make your 404s into 302s by ric2b on Friday May 29, 2020 @02:43PM (#23353903)
That sounds much better, love the idea and it's almost as easy, just need a custom 404 page template.
Re:Make your 404s into 302s by saalweachter on Friday May 29, 2020 @12:06PM (#23351679)
I could also see a 404 iFrame.
Re:Make your 404s into 302s by m-p-3 on Friday May 29, 2020 @08:35AM (#23349194)
Or sometimes a page stopped existing for a valid reason, and retrieving an old page that contains outdated information could do more harm than good.
Re:Make your 404s into 302s by owl57 on Friday May 29, 2020 @08:38AM (#23349226)
In an ideal world, a page that stopped existing for a reason would be replaced by some text about that reason, not a generic "there's nothing here".
Re:Make your 404s into 302s by _-___________-_ on Friday May 29, 2020 @08:42AM (#23349262)
This would be best conveyed by a 410 Gone response with explanatory text about the reason in the response body.
Re:Make your 404s into 302s by gravitas on Friday May 29, 2020 @09:07AM (#23349479)
These ideas don't scale though - a 404 handles everything, not just textual content pages (meaning like images, css, js, etc. - the underlying plumbing for most sites). Nobody is going to sit there and write 404/410 content for moved assets one by one when they rebrand their site, that's madness.

In my travels, most folks who actually care about this (SEO links) build an extensive alias/redirect map for the old/previous core URLs they want to remain functional as part of their rebrand, when the new site goes live the redirects are dropped in as well. This is especially true if they've ever published the URLs on physical media (mailed postcards, e.g.).

Re:Make your 404s into 302s by cxr on Friday May 29, 2020 @10:06AM (#23350087)
> Nobody is going to sit there and write 404/410 content for moved assets one by one when they rebrand their site

Maybe the monkey-do approach to web publishing that underlies those decisions is the problem.