4xx Client errors
HTTP 404 Not Found
HTTP 404 Not Found means the server has no resource at this URL, and says nothing about whether it ever existed.
What 404 Not Found means
A 404 is the correct answer for unknown URLs and missing records. A helpful 404 page links to the main sections. In a single-page app the page must still send status 404: with SSR, set the status on the response; without SSR, the server sends 200 for every route, which creates soft 404s.
Common causes
- A typo or an old link to a page that moved or was deleted.
- A slug that does not match any record in the database.
- An SPA route that exists only on the client.
How to fix or use it
Return a real 404 status with a useful page. Use 301 when a page moved, and 410 when it is gone for good. In Angular SSR, set the status through the RESPONSE_INIT token and add a noindex robots tag.
Express (Node.js) example
// Last middleware: anything no route matched
app.use((req, res) => res.status(404).json({ message: `No route for ${req.method} ${req.path}` }));
// Angular SSR component
const init = inject(RESPONSE_INIT, { optional: true });
if (init) init.status = 404;SEO impact
404s do not hurt the rest of the site; they are normal. Problems come from soft 404s (error pages sent with 200) and from internal links to missing pages. Fix the links and redirect pages that have a clear replacement.
