DD
DevDash

HTTP 404 Not Found: What It Means and When You See It

Quick Answer

HTTP 404 Not Found means the server cannot find the requested resource. The URL may be wrong, the resource may have been deleted, or it was never published.

Why HTTP 404 Occurs

HTTP 404 Not Found means the server cannot find the requested URL. Common causes: typo in the URL, resource was deleted, URL changed and no redirect was set up, dynamic routes not matched (missing slug), case-sensitive URL mismatch, and trailing slash differences (/users vs /users/). In Next.js, return notFound() from a page or API route to generate a 404. In Express: if no route matches, the default behavior is a 404 response.

Handling 404 in Code

Express.js catch-all 404: app.use((req, res) => { res.status(404).json({ error: "Not found" }); }). Next.js: create app/not-found.tsx for a custom 404 page. For API routes, call notFound() from next/navigation. In fetch(): const res = await fetch(url); if (res.status === 404) { /* handle missing resource */ }. Never cache a 404 without a short TTL - resources may be created later. For deleted resources, prefer 410 Gone.

Try the interactive tool

Convert any value instantly — no sign-up required

Open tool →

Frequently Asked Questions

Related Values

Want API access + no ads? Pro coming soon.