4xx Client Error

404 Not Found

What it means

404 is the most famous HTTP status code. It means the server can't find what you're looking for — like going to a bookshelf and finding the slot where a book should be is empty. Critically, 404 doesn't mean "gone forever" — the resource might exist later, or might have moved. Use 410 if you know it's gone permanently.

Site Visitor

What can I do?

  • Check the URL for typos — one wrong character causes 404.
  • Navigate back to the site's homepage and search from there.
  • If you followed a link, it may be broken — try searching for the content directly.
  • The page may have moved — try searching the site.
Developer

How to debug & fix

  1. Set up 301 redirects for moved pages immediately
  2. Create a custom 404 page that helps users find what they're looking for
  3. Monitor 404 logs to catch broken links and missing files
  4. Use 410 instead of 404 when a resource is permanently deleted
  5. Set up 301 redirects immediately for any URL you intentionally move.
  6. Create a custom 404 page with search and popular links to reduce bounce rate.
  7. Monitor 404 logs weekly to catch broken internal links.

Code Example

Node.js / Express
// Catch-all 404 handler (place after all routes)
app.use((req, res) => {
  res.status(404).json({
    error: 'Not Found',
    path: req.path
  });
});

Related Status Codes

How HTTP Status Codes Work

Every HTTP response carries a three-digit status code that tells the client — browser, API consumer, or search-engine crawler — exactly what happened. The first digit defines the class: 1xx informational (request in progress), 2xx success, 3xx redirection, 4xx client error (bad request, missing auth, not found), and 5xx server failure.

Status codes are standardised in RFC 9110 (HTTP Semantics, 2022). Extensions like WebDAV (RFC 4918) and rate-limit headers (RFC 6585) added codes beyond the core set. When a client receives an unrecognised code, the rule is to treat it as the generic x00 of its class.

Why the Right Code Matters

Semantically correct codes help search engines index accurately (301 passes link equity; 410 removes pages faster than 404), allow API clients to implement correct retry logic (429 + Retry-After, 503 + Retry-After), and let monitoring systems distinguish bugs (500) from load issues (503) from auth failures (401/403).

Looking up a different status code? The full reference covers all HTTP codes with causes, fix guides, and copyable code examples for Node.js and Python.

Browse the full HTTP Status Code reference →

Frequently Asked Questions

What does HTTP 404 Not Found mean?
404 is the most famous HTTP status code. It means the server can't find what you're looking for — like going to a bookshelf and finding the slot where a book should be is empty. Critically, 404 doesn't mean "gone forever" — the resource might exist later, or might have moved. Use 410 if you know it's gone permanently.
Is HTTP 404 the visitor's fault?
HTTP 404 Not Found is generally a client-side error, meaning the request itself has an issue. However, many causes — such as a broken link on the site or a misconfigured redirect — are the website owner's responsibility, not the visitor's.
How do I fix HTTP 404 Not Found?
As a visitor: check the URL for typos, go to the homepage, or search for the content. As a developer: set up 301 redirects for moved pages immediately.