A polished error page is only half the job. A nonexistent URL should return HTTP 404; if the host serves the homepage with status 200, search engines and monitoring tools may treat the response as a soft 404.

Make the error useful

  • Say plainly that the requested page could not be found.
  • Offer a link to the home page and relevant topic indexes, not a redirect to an unrelated page.
  • Keep the missing URL out of the sitemap and do not generate many alternate URLs that all show the same message.

Check the deployed response

curl -sS -o /dev/null -w '%{http_code}\n' https://example.com/does-not-exist/

Static hosts differ in how they configure fallback documents. Check the actual deployed response for a random missing path, not only the page rendered in a browser. Keep valid article routes returning 200 and redirects returning an intentional 3xx.

A useful 404 helps visitors recover; the correct status code tells clients and crawlers that the URL is not a published page.