Skip to content
FunnelGuard

Fix guide by FunnelsGuard

SPA routes return 200 for non-existent URLs: how to fix soft 404s

SEO-143Medium impactOther toolBy FunnelGuardPublished Updated
On this page

What this issue is

A single-page app loads one HTML file and then uses JavaScript to draw each page. To make deep links work, the server is usually set to send that same file for every path. This is often called a catch-all or fallback rule.

The side effect: a request to /this-page-does-not-exist gets HTTP 200 OK and the app shell. The router then shows a 'Page not found' screen in the browser. To a crawler or a monitoring tool that only reads the status code, the page looks valid. Search engines call this a soft 404.

How a missing URL becomes a 200 page
  1. RequestBot or visitor asks for /old-page-xyz
  2. Server fallbackCatch-all rule returns index.html with status 200
  3. JS routerShows 'Page not found' in the browser only
  4. IndexCrawler may keep the URL as a thin duplicate page

The server never learns the route is invalid, so it can't send a 404.

Why it costs you leads or sales

Search engines try to spot soft 404s, but they don't always get it right. When they don't, three things happen:

What soft 404s can cause
  • Crawl budget is spent on junk URLs instead of your product and landing pages.
  • Thin or duplicate 'not found' pages can appear in the index and dilute your site's quality signals.
  • Old, deleted pages keep showing in results, so visitors land on an error screen and leave.
  • Search Console reports become noisy, which hides real problems.
  • Ad or email links that mistype a path never trigger a proper error in your tools.
Where crawl attention goesExample numbers
Where crawl attention goes (example)Real pages: 55 % of crawled URLs; Soft 404 URLs: 35 % of crawled URLs; Redirects: 10 % of crawled URLs02142553510Real pagesSoft 404 URLsRedirects% of crawled URLs

Example: illustrative split for a site with many deleted pages that still return 200.

How to check if your site has it

Test your site in about five minutes
  1. Request a made-up URL

    Pick a path that can't exist, such as /fg-test-404-check-123, on your own domain.

  2. Read the status code

    In Chrome, open DevTools, go to the Network tab, reload, and click the first request. Look at 'Status Code'. Or run the curl command below.

  3. Compare with the screen

    If the page says 'not found' but the status is 200, you have the issue. You want 404 (or 410 for permanently removed pages).

  4. Check Search Console

    In Google Search Console open Pages (Indexing) and look for the reason 'Soft 404'. Use URL Inspection on a suspect URL to see what Google received.

  5. Test deep paths too

    Try a missing item under a real route, like /products/not-a-real-item. Apps often return 200 here even when the top-level 404 works.

Check the status code of a made-up URLbash
curl -s -o /dev/null -w "%{http_code}\n" https://www.example.com/fg-test-404-check-123

How to fix it

The best fix is for the server to know which routes are valid and to send status 404 for the rest. How you do that depends on your stack. If you can't change the server response, add a noindex tag to the not-found view as a weaker fallback.

Return a real 404 by platform
  1. Use server-side rendering or a route check

    With Next.js, call notFound() or return notFound: true so the page responds with 404. With Nuxt, use createError({ statusCode: 404 }). With a plain Express server, match known routes first and send res.status(404) for everything else.

  2. Keep the fallback only for real routes

    Don't send index.html for every path. List valid routes (or check your data source) and answer 404 when nothing matches.

  3. Set the not-found view to noindex

    If the server can't be changed, render <meta name="robots" content="noindex"> on the not-found route. Treat this as a backup, not a replacement.

Express: 404 for unknown routes, fallback only for known onesjavascript
const express = require('express');
const path = require('path');
const app = express();

const validRoutes = ['/', '/pricing', '/contact'];

app.use(express.static('dist'));

app.get('*', (req, res) => {
  if (validRoutes.includes(req.path)) {
    return res.sendFile(path.join(__dirname, 'dist', 'index.html'));
  }
  res.status(404).sendFile(path.join(__dirname, 'dist', 'index.html'));
});

app.listen(3000);
Fallback: noindex on the not-found viewhtml
<meta name="robots" content="noindex">
Missing URL response

Before

  • Status 200 for any path
  • 'Not found' text only after JavaScript runs
  • Soft 404s listed in Search Console

After

  • Status 404 (or 410) for unknown paths
  • Same friendly page for visitors, with links back to key pages
  • Crawlers drop dead URLs

How to confirm it's fixed

Confirmation checks
  • curl on a made-up URL returns 404, not 200.
  • A missing item under a real route (like /products/fake) also returns 404.
  • Valid pages still return 200 and load normally.
  • Visitors still see a helpful not-found page with navigation.
  • In Search Console, use URL Inspection on a former soft 404 and request a recrawl; then watch the Soft 404 count fall over the following weeks.

How to prevent it happening again

Habits that keep it fixed
  • Add a test to your deploy process that requests a made-up URL and expects 404.
  • Review the Soft 404 report in Search Console monthly.
  • When you delete products or posts, return 404 or 410, or 301 to a true replacement.
  • Re-test after changing hosting, CDN or router configuration, since catch-all rules are easy to reintroduce.
  • Keep a sitemap that lists only valid URLs.

How FunnelGuard handles this

FunnelGuard does not check this yet. Checking that a made-up URL returns a 404 status is a possible future check, but it isn't part of the product today.

What FunnelGuard does today is run your real customer journeys on a schedule, such as lead forms, checkouts and booking or chat buttons. It checks each step, the tracking hits sent to ad and analytics platforms, and whether test leads reach your inbox and CRM. That can show you when a page in a journey stops loading properly, but it won't tell you that other URLs return 200 by mistake.

To watch for this issue now, use the curl check above in your deploy pipeline, review the Soft 404 report in Google Search Console, or run a site crawler that reports status codes for random paths. You can also start with the free read-only website audit or the Free plan (1 site, 2 journeys, daily checks, no card) to cover your key funnels.

Questions people ask

Why does my single-page app return 200 for pages that don't exist?

Your server is probably set to send the same index.html file for every path so that client-side routing works. The server never checks if the route is valid, so it answers 200. The 'not found' message is drawn later by JavaScript in the browser.

What is a soft 404?

A soft 404 is a page that tells visitors it doesn't exist but sends a 200 OK status code. Search engines see a normal page rather than an error. Google reports these in Search Console under the Soft 404 reason.

How do I return a 404 status in a React or Vue SPA?

A purely client-side app can't change the HTTP status, because the server has already sent 200. Use server-side rendering (for example Next.js or Nuxt) or a server that checks routes and sends 404 for unknown ones. As a weaker fallback, add a noindex meta tag to the not-found view.

Is a noindex tag enough instead of a real 404?

It helps, because it tells search engines not to index the page. But a real 404 or 410 status is clearer and also stops crawlers from repeatedly fetching the URL. Use noindex only when you can't change server responses.

How can I check what status code a URL returns?

Run curl -s -o /dev/null -w "%{http_code}" followed by the URL, or open Chrome DevTools, go to the Network tab and click the first request to see its Status Code. Test a made-up path on your own domain.

Do soft 404s hurt my SEO rankings?

They don't usually cause a penalty, but they waste crawl budget and can leave thin pages in the index. The effect is larger on big sites or sites with many deleted pages.

Should I redirect all missing URLs to the homepage?

No. Redirecting unrelated URLs to the homepage is treated like a soft 404 by search engines. Redirect only when a close replacement exists; otherwise return 404 or 410.

Does FunnelGuard detect soft 404s?

Not yet. It is a possible future check. For now, use curl, Google Search Console's Soft 404 report or a crawler, and use FunnelGuard to monitor your key funnels and tracking.

Does FunnelGuard catch this?

Other tool

Needs a different kind of tool.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.