Understand the idea

A page can say “not found” while the server sends a successful HTTP response. The text and the response status describe different parts of the experience.

A genuinely unavailable URL normally needs an appropriate not-found response, commonly 404. The body can still contain a clear explanation and helpful navigation. Returning a success status for a missing page is often called a soft 404.

Read the example

A conceptual response example. Test an actually missing URL, not only the error-template file.

Diagnostic notes · EXAMPLE
Request: /a-page-that-does-not-exist/
Response status: 404
Response body: a helpful, branded error page

Different test: opening /404.html directly
That file may legitimately return 200.

Keep recovery useful

Say that the requested page was not found. Provide a home link and a route to search or navigation. Avoid immediately redirecting everyone to the homepage: that can hide the failed address and make diagnosis harder.

Routing is part of the implementation

Static hosts, application routers and server frameworks can use different fallback conventions. A filename alone does not establish the response behaviour. Inspect the deployment’s routing configuration before applying instructions meant for another host.

Missing assets deserve attention too

A broad application fallback can return the main HTML document for a missing stylesheet or script. Network may show a successful response, followed by a MIME-type error or a parser error. Check the requested resource type, Content-Type and response body together.

Explore the 42 design recipe. Its preview is intentionally a normal example page, not an actual missing-route test.

Continue the diagnostic toolkit

All six lessons and three cases · Next: Find blocked resources on HTTPS pages

A small mistake, explained

What goes wrong

You open 404.html, like its design and assume every missing URL now returns the right status.

How to fix it. Check a unique missing route on the deployed site. Inspect the document response status and confirm the intended error body appears. Test a valid page too, to catch overly broad fallback rules.

Try it yourself

Write a verification checklist for one valid route, one missing route and one missing asset. Explain why an image request receiving HTML is still broken even with status 200.

Further reading

MDN: 404 Not Found (new tab)

Original explanation and example prepared for HTML code FYI with AI assistance. Test the code in your own context. How these guides are made.