the internet's box_

log / Technology / Web & sites

Part 2 of 3 in Event Beam · series 1 (Dec 2026, ongoing)
earlier: Adding an "Add to Google Calendar" link to a paste demonext: robots.txt Pointed at a Sitemap That Was Really the SPA

· error log #spa #404 #seo #react #routing

Giving a single-page app a real 404 page

What happened

The site is a single-page app with no catch-all route. Any unknown path, such as a mistyped URL or an old link, just rendered the home page.

That causes two problems. Search engines can see many soft-404 duplicates of the home page, which wastes crawl budget and can dilute the canonical URL. Visitors also land on a page that doesn't tell them they took a wrong turn.

The fix / What I built

I added a small NotFound route. It's a lazy-loaded component, and a catch-all route in the routed app renders it for any path that nothing else matches.

The page does three things:

Why it works

The router now has an explicit answer for unknown paths instead of falling through to the home page. People see a clear message with a way back. The noindex tag tells crawlers not to index these URLs, so they stop competing with the real home page.