Tag: http

  • No, 404 Was Never a Room at CERN

    No, 404 Was Never a Room at CERN

    There’s a lovely story you’ll find all over the internet: at CERN, the first web servers lived in room 404. When people asked for a file that didn’t exist, staff would say the file couldn’t be found in room 404, and the name stuck.

    It’s a great story. It’s also not true.

    Where 404 actually comes from

    HTTP status codes are grouped by their first digit:

    • 2xx – success (200 OK)
    • 3xx – redirection (301, 302)
    • 4xx – the client asked for something wrong (404 Not Found, 403 Forbidden)
    • 5xx – the server messed up (500, 502, 503)

    So 404 simply means “client error, number 04”. It’s a number from a system, not a room on a floor.

    Fun 404 facts that are true

    • A page can show a “Not Found” message but still return 200 OK. That’s called a soft 404, and it confuses search engines.
    • Browsers request /favicon.ico automatically, so a site without one can collect a lot of 404s without anyone ever clicking a broken link.
    • Custom 404 pages are a great place for a search box and links to your most popular pages. Visitors who land there are lost, not gone.

    Source: Wikipedia – HTTP 404

  • HTTP 418: The Teapot That Refused to Leave

    HTTP 418: The Teapot That Refused to Leave

    Among the serious, sensible HTTP status codes (200 OK, 301 Moved Permanently, 500 Internal Server Error) sits one that is not serious at all: 418 I’m a teapot.

    Where it came from

    On 1 April 1998, an RFC was published describing the “Hyper Text Coffee Pot Control Protocol”, a completely real-looking technical document for controlling coffee pots over the internet. It was an April Fools’ joke, written in perfectly straight-faced standards language.

    In it, status code 418 means that the server refuses to brew coffee because it is, permanently, a teapot. The document even notes that the response body may be “short and stout”.

    Why it’s still around

    Developers loved it. It ended up in programming languages, frameworks and web servers as an Easter egg. When there was a suggestion in 2017 to remove it from some popular tools, people pushed back hard, and a “Save 418” movement was born.

    In the end, the official HTTP specification reserved 418 so it can’t be given a “real” meaning. The teapot stays.

    Is it useful for anything?

    Some websites actually return 418 to requests they don’t want to deal with, like certain automated bots. So if your monitoring tool ever reports a 418 from your site, it’s worth checking whether a security plugin or firewall is blocking it.

    Source: RFC 2324 – Hyper Text Coffee Pot Control Protocol