All writing

SEO / Engineering

Soft 404s: When Every Wrong Address Shows Your Homepage

5 min read Roland Farkas

Type a made-up address on your website. If you get your homepage instead of a ‘page not found’, you have a quiet problem that Google calls a soft 404. I’ve found it on two of my own sites this year. Here is the 30-second test, why it matters, and how to fix it.

Soft 404s: a request for a page that doesn’t exist returns 200 OK with the homepage, when it should return 404 Not Found

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?

  1. Add a real 404 page. On Cloudflare Pages, put a 404.html at the top level of your build output. Pages then serves the nearest 404.html for any address it can’t find, and the single-page app fallback switches off. In Astro, a src/pages/404.astro (or 404.md) builds to 404.html. If you serve a static site from a Cloudflare Worker instead, set the assets option not_found_handling to "404-page", and Workers serves your nearest 404.html with a 404 status.

  2. 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.

  3. 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
  4. 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.

  5. 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.

  6. Check it. Run the curl test 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.

FAQ

What is a soft 404?

Google uses the term for a page that tells the visitor it doesn’t exist, or has no real content, but returns a 200 (success) status code instead of a 404. Google excludes these pages from Search and lists them as soft 404 errors in Search Console’s Page Indexing report. It also treats redirects from missing pages to an unrelated page, such as your homepage, as soft 404s.

Are 404 errors bad for SEO?

Not in themselves. Google says returning a 404 or 410 for pages that no longer exist, or never existed, is a normal part of how the web works and won’t harm your site’s indexing or ranking. Fix the ones that should work, such as a page removed by mistake or an old address with a real replacement.

Should I redirect missing pages to my homepage?

No. Google says to redirect only when there’s an equivalent replacement page, and treats redirects from missing pages to the homepage as soft 404s. For an address with no replacement, a plain 404 with a helpful 404 page is the right answer.

Sources

  1. Google Search Central: Soft 404 errorsWhat a soft 404 is, how to fix one, when to redirect, and tips for a useful 404 page.
  2. Google Crawling Infrastructure: How HTTP status codes affect Google’s crawlers
  3. Google Search Central: Avoid soft 404s in single-page apps
  4. Cloudflare Pages: Serving Pages (Not Found behavior and SPA rendering)
  5. Cloudflare Pages: Redirects
  6. Cloudflare Workers: Static Site Generation and custom 404 pages
  7. Astro docs: Pages (custom 404 error page)
#soft 404#404 page#Cloudflare Pages#Astro#redirects#Google Search Console