mastodon.ar.al is one of the many independent Mastodon servers you can use to participate in the fediverse.
This is my personal fediverse server.

Administered by:

Server stats:

1
active users

Aral Balkan

(Re)introducing 404 → 307 (the evergreen web technique)¹

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 307s.

4042307.org/

¹ Previously, I was doing 404 to 302 but 302 redirects do not keep the request method so 307 is the correct redirect to use. I’d been meaning to update the site for ages and so I finally made some time to do so this week.

#4042307

And, of course, Kitten now has native support for 404 → 307.

codeberg.org/kitten/app#404-30

(Currently for developers to play with via the Kitten.json file but soon to be exposed as a setting in the web-based settings interface.)

#4042307

Codeberg.orgappA web development kit that’s small, purrs, and loves you.

@aral I recently did this and found that lots of older clients that used my RSS feed wouldn’t follow the 307 redirect because they hadn’t been updated in 10-15 years.

@ramsey That’s on them. We do the best we can :)

@aral I switched back to 302 because too many of them were failing to redirect.

@ramsey Fair enough. Would be good to document that. (I’ll make myself a note to do so.)

@aral Interesting, thanks. What I did not get fully yet is the need to do a 307 instead of a 302 here. Besides a decreased client support and differences in the handling of HTTP method changes, I do not see a real difference. Can you tell me where I can find more reasoning for the 307 over 302 decision?

@leitmedium If your previous site is a dynamic site then any POST, etc.., requests will fail. Especially if they are absolute URLs instead of relative.

If this isn’t a concern for you, then by all means use 302 for greater compatibility.

@aral First time I’ve heard of 4042307, I really like the idea!

It’s perfect for one of the sites I have that’s been going for over 20 years now. We really like keeping the old content within the site design from that era, so we’ve made it possible to navigate from the current site through various versions all the way back to the original from 1999.