Here’s a test you can do right now. Go to your website and add a made-up path to the address, like /this-page-does-not-exist.
- If you see a “page not found” message, good. Your site is probably fine, but check the status code below to be sure.
- If you see your homepage, or any normal page, with the made-up address still in the address bar, read on.
What you see is only half of it. What search engines and other software care about is the HTTP status code that comes with the page. In a terminal (use curl.exe in Windows PowerShell):
curl -sI https://yoursite.com/this-page-does-not-exist
The first line should say 404. If it says 200, your site is telling every visitor, and every crawler, that a page that doesn’t exist is fine. You can see the same thing in your browser: open the developer tools, go to the Network tab and reload the page.
I’ve found this on two of my own sites
After I moved this site from a React app to Astro on Cloudflare Pages, an audit in September found that old addresses Google had indexed, like the old service pages, were returning the homepage with a 200 OK.
Then in November, an AI readiness audit of subba.pro tripped over the same thing. Every file the scanner looked for that didn’t exist came back as the homepage, with a success code.
Both had the same cause. Cloudflare Pages has a fallback for single-page apps: if it can’t find a file for an address, and there’s no custom 404.html, it serves the root index.html, so the app can handle the route in the browser. A static site that doesn’t include a 404 page gets that behaviour by default. Neither of my sites is a single-page app, and neither had a 404.html.
Why does it matter?
Google treats it as an error, not a page. Google’s term for a page that says it doesn’t exist (or has no real content) but returns a 200 is a soft 404. Those pages are excluded from Search and show up as soft 404 errors in Search Console’s Page Indexing report. Google is just as clear about sending missing addresses to your homepage: it confuses people and search engines, and Google treats those as soft 404s too. Serving the homepage at a wrong address isn’t technically a redirect, but the effect is the same: an address that should say “not found” says “everything’s fine” instead.
People get lost. Someone following an old or mistyped link lands on your homepage with no explanation, and has to guess whether the page they wanted still exists.
Software gets the wrong answer. Link checkers, monitoring tools and AI agent scanners often decide whether something exists from the status code. A 200 says yes. On subba.pro, the scanner asked for files that weren’t there and got the homepage back.
Moved pages never pass people on. When you rebuild a site, old addresses keep getting visits from bookmarks, other sites and search results. If they quietly return the homepage, the ones that moved never send anyone to the new page.
How do you fix it?
-
Add a real 404 page. On Cloudflare Pages, put a
404.htmlat the top level of your build output. Pages then serves the nearest404.htmlfor any address it can’t find, and the single-page app fallback switches off. In Astro, asrc/pages/404.astro(or404.md) builds to404.html. If you serve a static site from a Cloudflare Worker instead, set the assets optionnot_found_handlingto"404-page", and Workers serves your nearest 404.html with a 404 status. -
Make the page helpful. Google’s tips: say clearly that the page can’t be found, keep your normal design and navigation, and link to your most useful pages and your homepage. And make sure it really returns a 404 status, so the error page itself isn’t indexed.
-
Redirect old addresses that have a real replacement. If a page moved, a permanent redirect (a 301) sends people and search engines to the new address. On Cloudflare Pages, that’s a line in a _redirects file. Pages uses a temporary 302 unless you give a code, so add 301 for permanent moves:
/old-services-page /services 301 /blog/category/* /blog 301 -
Don’t redirect everything to the homepage. It’s tempting to catch every missing address and send it home. Google says to redirect only when there’s an equivalent page, and treats blanket redirects to the homepage as soft 404s. For an address that never existed, a plain 404 is the right answer.
-
Don’t chase every 404 in Search Console. Google says 404s for pages that don’t exist are a normal part of the web, and won’t harm your site’s indexing or ranking. Act on the ones that should work: a page removed by mistake, or an old address people still use that has a real replacement.
-
Check it. Run the
curltest again, and use the URL Inspection tool in Search Console on an old address to see what Google gets.
What if your site really is a single-page app?
Then the fallback is there for a reason: the browser handles the routing, so the server sends the same index.html for every address, and the app has to deal with addresses it doesn’t know. Google’s advice for this case is to either redirect with JavaScript to a URL that returns a real 404, or add a noindex robots meta tag to the error view.
It’s one small file, and on both of my sites it was one of the most useful fixes either audit turned up.