Skip to main content
HTTP/4xx (Client Error)

404 Not Found

The server cannot find the requested resource. Links that lead to a 404 are often called broken or dead links.

❓ Why does this happen?

Typo in route URL, deleted database resource, or unpublished page.

✅ How to fix it

Verify the URL path, check routing configurations, and update any broken references.

Return or handle 404 in your stack

// app/api/resource/route.ts
export function GET() {
  return Response.json(
    { error: "Not Found", status: 404 },
    {
      status: 404
    }
  );
}

Live 404 mock endpoint

Point your app, tests, or retry logic at this free public URL to reproduce a real 404 response (CORS enabled, optional ?delay=ms up to 5000).

https://castov.com/api/mock/404

404 vs similar status codes

Frequently Asked Questions

What does HTTP Status 404 mean?
The server cannot find the requested resource. Links that lead to a 404 are often called broken or dead links.
Why am I getting a 404 status code?
Typo in route URL, deleted database resource, or unpublished page.
How do I fix a 404 Not Found error?
Verify the URL path, check routing configurations, and update any broken references.
What is the difference between 404 Not Found and 410 Gone?
404 means the resource is not found and may come back. 410 tells clients and search engines it was removed permanently, so it is de-indexed faster.
What is the difference between 404 Not Found and 403 Forbidden?
Some APIs return 404 instead of 403 to avoid revealing that a private resource exists (security through non-disclosure).
How can I test how my app handles a 404 response?
Send a request to https://castov.com/api/mock/404 — it returns a real 404 Not Found response with CORS enabled. Add ?delay=2000 to simulate a slow server.

Other 4xx status codes

Browse the full HTTP status codes directory or troubleshoot terminal errors in the Error Fix Encyclopedia.