Hacker News new | past | comments | ask | show | jobs | submit login

There's a HTTP status code for pages which were deleted: 410 Gone.

https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#4xx_...

This was famously used by Mark Pilgrim:

https://en.wikipedia.org/wiki/Mark_Pilgrim#%22Disappearance%...




Has anyone ever seen this in the wild? I didn’t even know it existed. Who knew there were so many different status codes.


I'm sure I've seen 410 in the wild, but it's pretty uncommon. If you're keeping track of things well enough to know that there used to be a page there in order to serve a 410, you're probably keeping track of things well enough to be able to do something better, like redirect to an updated URL.

> Who knew there were so many different status codes.

As an HTTP nerd, the authoritative listing of the different codes is: https://www.iana.org/assignments/http-status-codes

Note: Everything with a reference that's not RFC 7231 is an extension; don't use that status code unless you actually implement that extension. For example, don't use 401 (Unauthorized) instead of 403 (Forbidden) unless you actually implement the RFC 7235 Authentication extension.


I use it to mark pages that I have taken down for good [1]. I have also used 418 ("I'm a teapot") response code on my gopher server to discourage web bots from attempting to index the site.

Edit--added note

[1] For all the good it does. I just checked my logs and I still see requests for pages I marked as "gone" 15 years ago.


I use it for APIs when an item gets marked as deleted, vs actually deleted... depends on the underlying data though.


Seems that I edited my comment to add an example at the same time you posted yours.


GitLab does it for links to deleted repos!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: