MockFoxAdvertise

HTTP 404 Not Found

Updated Free mock REST & WebSocket APIs

HTTP 404 Not Found — The server can't find anything at the requested URL.

Class
4xx Client Error
Defined in
RFC 9110 §15.5.5
Official
Yes (IANA registry)
Cacheable by default
Yes (heuristically, per RFC 9110)
Safe to retry
Not without changing the request

Try it: get a real 404 response

Our test endpoint answers every request with 404 Not Found.

curl -i https://mockfox.dev/api/status/404

Use it in tests, health-check monitors or to see how your client handles a 404. Add ?delay=2000 to slow it down.

What does HTTP 404 mean?

404 Not Found means the server has no resource at the requested URL — or isn't willing to say that one exists. It says nothing about whether the absence is temporary or permanent (use 410 Gone for deliberate, permanent removal).

It's the most famous HTTP error and, for websites, a normal part of life: deleted pages, typos and broken links all produce it. What matters is serving a helpful 404 page and fixing links you control.

When is 404 used?

  • A page or file was deleted or moved without a redirect.
  • A typo in a link or the address bar.
  • An API route or resource id doesn't exist (GET /api/users/99999).
  • A single-page app is deployed without a fallback, so refreshing /dashboard 404s on the server.

Common causes of a 404

  • Broken internal or external links pointing at old URLs.
  • Case-sensitive paths on Linux servers (/About vs /about).
  • Missing build output or wrong root/try_files configuration in nginx.
  • A routing rule or rewrite that doesn't match after a deploy.

How to fix 404 Not Found

If you're visiting the site

  1. Check the URL for typos and wrong capitalisation.
  2. Go up one level in the path, or use the site's search or navigation.
  3. Search for the page title on a search engine, or check the Wayback Machine (web.archive.org) for removed pages.

If you run the site or API (developers)

  1. Add 301 redirects for moved content, and fix internal links (crawl your site to find them).
  2. Make sure missing pages return a real 404 status, not a 200 "soft 404".
  3. For SPAs, configure a fallback to index.html (nginx try_files $uri /index.html;) and render a 404 view client-side for unknown routes.
  4. Monitor 404s in your logs or Search Console's Pages report and redirect the ones with traffic or backlinks.

Returning or handling 404: server examples

nginx

server {
    root /var/www/site;
    error_page 404 /404.html;
    location / {
        try_files $uri $uri/ =404;   # SPA: try_files $uri /index.html;
    }
}

Express

app.get("/api/users/:id", async (req, res) => {
  const user = await db.users.find(req.params.id);
  if (!user) return res.status(404).json({ error: "not_found" });
  res.json(user);
});

// Catch-all after every route
app.use((req, res) => res.status(404).send("Page not found"));

Next.js

// app/blog/[slug]/page.tsx
import { notFound } from "next/navigation";

export default async function Post({ params }) {
  const post = await getPost((await params).slug);
  if (!post) notFound(); // renders app/not-found.tsx with status 404
  return <article>{post.title}</article>;
}

Example 404 response

HTTP/1.1 404 Not Found
Content-Type: text/html; charset=utf-8
Cache-Control: no-cache
Content-Length: 1532

Do 404 errors hurt SEO?

404s for pages that genuinely don't exist are normal and don't hurt your site's rankings; Google simply drops those URLs over time. Problems arise when important pages 404 by mistake, when many internal links are broken (wasting crawl budget and frustrating users), or when a moved page with backlinks 404s instead of redirecting — its link equity is lost. Fix those with 301 redirects.

Related status codes

Related tools

Frequently asked questions

What does error 404 mean?

The website's server is reachable, but it has nothing at that exact address. The page may have been deleted or moved, or the link has a typo.

Should I redirect all 404s to the homepage?

No. Google treats mass redirects to the homepage as soft 404s, and users lose context. Redirect only to a genuinely equivalent page; otherwise return a helpful 404 page.

What's the difference between 404 and 410?

404 means not found, with no indication of permanence. 410 Gone states the resource was intentionally removed and won't return, so clients and crawlers can drop it.

Why does my React/Vue app 404 on refresh?

The server looks for a file at /dashboard and doesn't find one. Configure it to serve index.html for unknown paths so the client-side router can handle them.