News for hackers. Stuff that matters.
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)