404 → 302

A simple gesture for an evergreen Web.

What if links never died? What if we never broke the Web? What if it didn’t involve any extra work?

It’s possible. And easy.

Just make your 404s into 302s.

Thoughts, suggestions, and contributions welcome:

PS. Looks like tried to index the missing page and so the final 404 now forwards to Yahoo Domains! 🤦

(I’m currently downloading a local copy of my old Geocities page so I can serve – and back it up – myself and I’ll update the link in the example once that’s ready. Also flying to Belgium today to kickstart a very exciting project that we’re collaborating on with the City of Ghent so apologies if it’s not fixed immediately.)

Right, now serving a downloaded copy of my Geocities site instead of hitting @internetarchive directly so the examples on should all work perfectly now.

Also: testament to how quickly you can set up a different version of your site with this technique :)

@aral Interesting idea! Simple and effective. Thank you 😀

@aral Is the redirect possible for Apache as well? I maintain my own domain and server, but I'm no expert in the web server stuff. If at all possible, could you please provide the documentation for Apache as well?

@masoud Indeed, the same technique will work. My hope is that others will contribute the necessary configurations for other platforms (I don’t use Apache). I’m sure someone will soon :)

@aral I really like the message of trying to get web publishers to think about creating their own archives, instead of relying on the Internet Archive A distributed web needs a distributed archive, and many different types of archives.

The first step of "Backup your current site to a subdomain" is the hardest part I think. While it's relatively easy for a static site, what does it mean for a dynamic web application?

@inkdroid It was badly worded, I didn’t mean backup as in a static backup, I meant “serve your old site from a different subdomain.” So, even for dynamic sites, mostly a trivial DNS change. The use case doesn’t really extend to pages that require a login.

@aral if the host name is simply an alias to the current website how is that an archive — how can its contents persist after the main site changes or has content deleted from it?

@aral Hah, the number of times I explained it to site administrators who replied (sniggered, even) that no one ever bookmarks a page. And then ignored me completely. Thousands of resources moved and were never found again.

@aral I'll look into making this work with Netlify and Caddy. Sound very cool! :)

@cemk That would be awesome :) The Netlify folks are very supportive/friendly. I was thinking of talking to them too :)


This is a perfect use case for practical application of the current level of #automation tools.

There is a lot of #database-/#fileManagement related #maintenance tasks in need of "AI"-powered #controlpanel #middleware / #plugins automation.

("#AI" is overhyped, so I prefer labelling it "Finally-Flexible-Features-For-Increased-Automation", or #F4iA ("for-aye" :-).)


@aral this is an interesting idea, redirecting to previous versions. Could that be automated using perhaps?

@aral silent failure will only confuse people. it's much better to give an indication of failure. i hate when I just get dumped unceremoniously to a home page, with no indication of anything going wrong.

@trwnh I agree, silent failure is very confusing. That’s why this technique doesn’t fail silently. If a URL cannot be found in any version of the site, a 404 is given.

@aral it seems there's an implicit assumption that any unfound link will necessarily exist somewhere further back, cascading through previous versions of the site -- is this correct? and if it was malformed, then it will be served a standard 404 on the oldest site?

@trwnh Correct (and yes, it terminates with a 404 on the oldest version of the site. On, that’s the “a page that never existed” link.)

Please do let me know if you have any suggestions on how I can phrase it so that it’s clearer :)

@aral well, the landing page makes it seem that ALL 404s become 302s. the nginx snippet doesn't really clarify which server it applies to; perhaps either include an additional redirect or include the server block's name as perhaps three tiny server block snippets to further illustrate the * > 2017 > 1997 > 404.html cascade?

@trwnh Thanks again for the nudge and the suggestions. I just tweaked the site, taking your suggestions in to consideration. Hope it’s a bit easier to follow now:

@aral i really think having multiple error_page listings would be easiest (on the homepage + on the how page)

something like

server ( #
location / (
error_page 404=302

server (
location / (
error_page 404=302

server (
location / (
error_page 404 /404.html

Sign in to participate in the conversation
Aral’s Mastodon

This is my personal Mastodon.