DevToolsmith

HTTP 404 Not Found

HTTP 404 Not Found means the server can’t find the requested resource. The request contains an error or can’t be fulfilled. Retrying unchanged won’t help.

Class
4xx Client error
Standard
RFC 9110
Cacheable by default
Yes
Safe to retry
No
Go constant
http.StatusNotFound

What HTTP 404 means

The most familiar error: nothing exists at this URL, or the server won’t say whether it does. 404 doesn’t say whether the absence is temporary or permanent; if a page was deliberately removed for good, 410 Gone is more precise. Search engines drop pages that consistently return 404.

How to fix a 404 error

  • Check the URL for typos, case sensitivity (Linux servers treat /About and /about as different) and trailing slashes.
  • Single-page apps on static hosting return 404 on refresh unless the server rewrites unknown paths to index.html.
  • An API may return 404 for a wrong base path or version, e.g. /v1/ instead of /api/v1/.
  • Return a real 404 status for missing pages. A “not found” page with status 200 is a soft 404, which hurts SEO.

Retrying

No. Fix the request first; sending it again unchanged will get the same response.

Example response

HTTP/1.1 404 Not Found
Date: Wed, 21 Oct 2026 10:30:00 GMT
Content-Type: text/html; charset=utf-8

How to return 404

Node.js (Express)
res.status(404).json({ error: 'Not Found' });
Python (FastAPI)
from fastapi import HTTPException

raise HTTPException(status_code=404, detail="Not Found")
Go (net/http)
http.Error(w, http.StatusText(http.StatusNotFound), http.StatusNotFound)
nginx
location /private/ {
    return 404;
}

Related status codes

  • 410 Gone : The resource was deliberately removed and won’t come back.
  • 403 Forbidden : The server understood the request but refuses to authorize it.
  • 301 Moved Permanently : The resource has a new permanent URL, given in the Location header.

Other 4xx status codes

400 Bad Request · 401 Unauthorized · 402 Payment Required · 403 Forbidden · 405 Method Not Allowed · 406 Not Acceptable · 407 Proxy Authentication Required · 408 Request Timeout · 409 Conflict · 410 Gone · 411 Length Required · 412 Precondition Failed · 413 Content Too Large · 414 URI Too Long · 415 Unsupported Media Type · 416 Range Not Satisfiable · 417 Expectation Failed · 418 I’m a Teapot · 421 Misdirected Request · 422 Unprocessable Content · 423 Locked · 424 Failed Dependency · 425 Too Early · 426 Upgrade Required · 428 Precondition Required · 429 Too Many Requests · 431 Request Header Fields Too Large · 444 No Response · 451 Unavailable For Legal Reasons · 499 Client Closed Request

See the full list of HTTP status codes.

Sources

Spotted a mistake? Email hello@devtoolsmith.com and we’ll fix it.

Frequently asked questions

What does HTTP 404 Not Found mean?

HTTP 404 Not Found means the server can’t find the requested resource. The most familiar error: nothing exists at this URL, or the server won’t say whether it does. 404 doesn’t say whether the absence is temporary or permanent; if a page was deliberately removed for good, 410 Gone is more precise. Search engines drop pages that consistently return 404.

How do I fix HTTP 404?

Check the URL for typos, case sensitivity (Linux servers treat /About and /about as different) and trailing slashes. Single-page apps on static hosting return 404 on refresh unless the server rewrites unknown paths to index.html. An API may return 404 for a wrong base path or version, e.g. /v1/ instead of /api/v1/. Return a real 404 status for missing pages. A “not found” page with status 200 is a soft 404, which hurts SEO.