40% off month one for the first 200 websitesSee pricing

How to fix soft 404 errors on a single page app

On a single page app every address answers 200, so Google logs soft 404s. How to test it with curl and send a real 404 from your host.

Published 10 min read
A Dead End traffic sign seen up close
Photo: Gabriel Soto on Unsplash

Search Console lists some of your pages under "Soft 404," and you are not sure why. Or you type a made-up address on your site, see a friendly "Page not found," and then learn that your server told Google the page loaded fine. On a single page app, every address answers with a 200: a typo, a deleted post, a product you stopped selling.

The fix is to send a real 404 for addresses that have no page, and the host does most of that work. This post shows how to test your site with one command, three ways to fix it from strongest to weakest, and how to tell Google the problem is gone.

What a soft 404 is

Google's Page indexing report defines it. A soft 404 is a page that "returns a user-friendly 'not found' message but not a 404 HTTP response code." Google's advice is short: "We recommend returning a 404 response code for truly 'not found' pages."

The status code matters because Google acts on it. Its docs say "Google doesn't index URLs that return a 4xx status code," and pages already in the index that start to return one "are removed from the index." A 404 is a clear answer. A 200 with a "not found" message leaves Google to guess.

The same guess can catch a page that is real. Google's docs say Search Console shows a soft 404 when a page with a 200 status has content that suggests "an empty page or an error message." A page that looks empty until its code runs can land in the same bucket. In our study of vibe coded home pages, 4 in 10 showed no words on Google's first look, and nearly all of them filled in once the code ran.

Why every address on a single page app says 200

A client side rendering app has one HTML file, index.html. The browser loads it, and your router decides what to show for the address. For that to work on a deep link such as /pricing, the host must send index.html for addresses that are not files. Each host has a rule for it:

  • Vercel. Its Vite guide gives a rewrite with "source": "/(.*)" and "destination": "/index.html", so that deep links work.
  • Netlify. The rule is /* /index.html 200. Netlify's docs say it serves "the index.html instead of giving a 404 no matter what URL the browser requests."
  • Cloudflare Workers. With not_found_handling set to "single-page-application", Cloudflare serves "the contents of the /index.html file with a 200 OK status."

The host sends the status before your app starts. By the time your router draws its not-found screen, the 200 is already on its way.

Vercel says it plainly: "Because every request matches that rewrite, Vercel never serves 404.html." And: a "not found" view that a client-side router renders "still has a 200 status code, which search engines can treat as a soft 404." Google's JavaScript SEO guide agrees that on these apps "using meaningful HTTP status codes can be impossible or impractical."

Check yours with one command

Ask for the headers of an address that cannot exist:

curl -I https://www.example.com/this-page-does-not-exist-4821

Read the first line. HTTP/2 404 means your host already does the right thing. HTTP/2 200 means every missing address on your site is a soft 404 waiting to happen.

Run it a second time on an address that used to exist, such as a deleted post. Then open Search Console:

  1. Open the Page indexing report and look for a "Soft 404" row.
  2. Choose an example address from that row to open it in URL Inspection.
  3. Run the live test and choose View tested page. Google says it shows a screenshot of the page and the HTML your server sent.

The screenshot tells you which case you have. A "not found" screen means the address really has no page. A blank or half-drawn page means a real page looked empty to Google.

The same three addresses, before and after the fix

BeforeAfter
/pricing, a real page200, your app200, your app
/blog/a-post-you-deleted200, your app's not-found screen404, or a not-found page marked noindex
/typo-anyone-could-make200, your app's not-found screen404 from the host
What each address answers. After the fix, only real pages answer 200.

Fix it, strongest first

1. Let the host send a 404 for addresses that are not routes

Swap the rule that sends every address to index.html for rules that send only your real routes there. Then give the host a 404 page for everything else.

On Vercel, list your routes in vercel.json:

{
  "rewrites": [
    { "source": "/", "destination": "/index.html" },
    { "source": "/pricing", "destination": "/index.html" },
    { "source": "/about", "destination": "/index.html" },
    { "source": "/blog/(.*)", "destination": "/index.html" }
  ]
}

Then add public/404.html. Vercel says it serves that file "with a 404 status code for every request that doesn't match another file and doesn't start with /api." Its docs give a plain HTML example with a heading and a link to the home page.

On Netlify, the _redirects file takes the same idea:

/pricing    /index.html   200
/about      /index.html   200
/blog/*     /index.html   200

Netlify's docs say that if you add a 404.html page to your site, "it will be picked up and displayed automatically for any failed paths."

On Cloudflare Workers, set not_found_handling to "404-page". Cloudflare then serves "the nearest 404.html file" with "a 404 Not Found status." That mode suits a site where each route is built into its own HTML file. On a pure single page app, it would send 404 for your real deep links too.

This fix has a gap. /blog/(.*) sends every address under /blog/ to your app, including a post that does not exist. For those, use fix 2.

2. Handle missing content inside the app

Google's JavaScript SEO guide gives two ways out for a page the host cannot judge:

  • "Use a JavaScript redirect to a URL for which the server responds with a 404 HTTP status code (for example /not-found)."
  • "Add a <meta name="robots" content="noindex"> to error pages using JavaScript."

With fix 1 in place, the redirect works well, because /not-found is not a route and your host answers it with a real 404:

function PostPage({ post }) {
  if (!post) {
    window.location.replace("/not-found")
    return null
  }
  return <article>{/* the post */}</article>
}

Without fix 1, use the noindex tag on your catch-all route instead. With React 19, a component can render it directly, as the React SEO guide for Vite shows.

3. Send real HTML for each route

The full fix is to stop sending one file for every address. Vercel's advice for real 404s on unknown addresses is to "render those routes on the server or prerender them with a framework that supports it." When each route has its own HTML, any address without one gets your host's 404.

On Lovable, this depends on the generation. Lovable's docs say apps created from May 13, 2026 run on TanStack Start, which "renders each page into finished HTML on the server before sending it." Older React and Vite apps keep that stack unless the owner upgrades. The JavaScript SEO guide for vibe coded sites covers that choice route by route.

A page that moved is not a 404

If a page has a new address, send a 301 redirect to it instead of a 404. How to set up 301 redirects after a site move covers the rules for each host.

Prompt for Claude Code or Cursor
Find out how this single page app answers addresses that have no page. Report first, and change nothing until I say yes.

1. Read the host config (vercel.json, netlify.toml, _redirects or the wrangler config). Quote any rule that sends every path to index.html.
2. List every route in the router, and mark the ones with a parameter, such as a post or a product.
3. For each route with a parameter, show what the app does when the item is not found. Does it show a not-found screen, redirect, or add a noindex tag?
4. Is there a 404.html in the folder the build serves at its root?

Then propose the smallest change that makes the host answer 404 for any path that is not a route, and makes each route with a parameter redirect to /not-found when its item is missing.

Paste it in your tool, opened in your site's repository.

Tell Google it is fixed

Run the curl -I check again on a made-up address and on a deleted one. Both should start with a 404.

Then go back to the Soft 404 row in the Page indexing report. Google's help says: "When you've fixed all instances of an error or warning, click Validate Fix to let Google know that you've fixed the issue." It also says not to click it again "until validation has succeeded or failed." Missing addresses then move from "Soft 404" to "Not found (404)," which Google says is "not necessarily a problem, if the page has been removed without any replacement."

If real pages sat in the Soft 404 row, those need content Google can see, and crawled, currently not indexed covers what to change.

How Vunora checks this

Vunora's SEO checklist has no soft 404 check, and no check reads Search Console's indexing status. Two of its checks see the cause from the other side.

  • Pages render on the server reads the HTML your server sends for each page. When every page sends the same HTML, the check fails. That is the same condition that makes every address answer 200. Its card says what to do: "Build your pages as HTML on the server or at build time, so each address sends its own page."
  • No broken links follows the links in your pages' HTML and lists any that answer with a 4xx or 5xx. On a single page app, it often cannot help. When the home page sends no links in its HTML, it says "Not checked: the home page sends no links in its HTML, so the check cannot see how your pages link." And a link to a missing page answers 200 there, so no status check can catch it.

If a site that used to send its own HTML for each address starts sending one page for every address, Vunora tells the workspace's admins once. This can happen when a site is rebuilt with a tool that builds every page in the browser. The checklist guide covers both checks.

Where this stops

  • Vunora never hosts your site. It does not add 404 handling to your host or to your router. The fixes above are changes in your repository, by you or a developer.
  • Vunora does not change how your site builds its pages. A Vite app stays a single page app after the import.
  • Vunora reads no Search Console indexing status, so it does not see your Soft 404 row.
  • Google decides what counts as a soft 404. A real 404 for missing pages removes the guess, but no tool can promise how Google files a page.

Questions

Is a soft 404 bad for SEO?

For a page that is really gone, a soft 404 leaves Google to work out that nothing is there, when a 404 would tell it. For a real page it is worse, because Google files the page under Soft 404 and does not index it. Both go away when missing addresses answer 404 and real pages show their content.

Should I send missing pages to the home page?

For a page that is gone, Google recommends "returning a 404 response code." For a page that moved, use a 301 redirect to its new address. Neither one is the home page.

Can a real page be marked as a soft 404?

Yes. Google counts a page with a 200 status as a soft 404 when its content suggests "an empty page or an error message." Use URL Inspection's live test and View tested page to see what Google got.

How do I return a 404 from a React app?

The app cannot change a status the host already sent. Make the host answer 404 for paths that are not routes, and have the app redirect to such a path, or add a noindex tag, when an item is missing.

Sources

Terms in this post

Share

New posts by email

One email when a post goes up, about editing and publishing a vibe coded site.

We use your email only to send new posts, and every email has an unsubscribe link. See the Privacy Policy.

Three ways to start

  1. Do it yourself

    Connect your GitHub and see the answer on screen.

    Join the waitlist
  2. Talk to us

    We look at your site with you and answer your questions.

    Book a call
  3. Send it to your developer

    Your developer gets one page that explains the step.

    Email your developer

Built your site with an AI coding tool? Edit it here, no prompt needed.

Connect your site. Vunora tells you if it works for your site and what it will cost. You pay only after that.

Join the waitlistBook a callOne plan, set by your page count · AI from a prepaid wallet with a monthly limit · See pricing