Skip to content
Webmaster Tools

404 Not Found

What HTTP 404 Not Found means, how to serve a custom 404 page with the right status, how soft 404s happen, and what Google really does with 404 URLs.

All status codes

What 404 means

The server has nothing at this URL, or won't say whether it does. 404 is defined in RFC 9110 §15.5.5. It doesn't say whether the absence is temporary or permanent; for content removed on purpose, 410 Gone says that more clearly.

HTTP/1.1 404 Not Found
Content-Type: text/html; charset=utf-8

<!doctype html><title>Page not found</title>...

The body can be a helpful page with search and links; what matters is the status line. A 404 is cacheable by default, so CDNs may keep it for a while: purge after publishing a page at a URL that used to 404.

Common causes

  • Deleted or renamed pages without a redirect.
  • Typos in links, from your own site or someone else's.
  • Case or trailing-slash mismatches (/About vs /about) on servers that treat them as different.
  • Missing static files after a deploy, such as hashed CSS or JS names that changed.
  • Rewrite rules that don't send requests to the app (a front controller like index.php not configured).

How to serve a proper 404

nginx: error_page 404 /404.html; keeps the 404 status (don't write error_page 404 =200 ...).

Apache: ErrorDocument 404 /404.html. Use a local path: with a full URL (https://...) Apache redirects to the error page and the client gets a 302 instead of a 404.

Express: add a catch-all after every route:

app.use((req, res) => res.status(404).render('404'));

Cloudflare and static hosts usually serve a 404.html from the site root with the right status; check yours does.

Soft 404s

A soft 404 is a page that says "not found" (or has almost no content) but answers 200. Common sources: CMS templates, empty search or category pages, and single-page apps whose server returns index.html with 200 for every path. Fix the server to return 404 for unknown URLs. In a client-rendered app, Google suggests either redirecting to a URL where the server answers 404, or adding <meta name="robots" content="noindex"> from JavaScript on the not-found view. Redirecting every missing URL to the home page also counts as a soft 404.

404 and SEO

Google drops URLs that return 404 from its index over time (it may recheck them for a while), and 404s for pages that never existed don't hurt the rest of your site. They are listed as "Not found (404)" in Search Console's Page indexing report; fix the ones that come from your own links or sitemap, and redirect with 301 only where there's a real replacement page. A 404 for /robots.txt means Google crawls with no restrictions.

Check what a missing URL really returns, or whether it redirects somewhere first, with the Redirect Checker.