How to Fix Soft 404 Pages and Return a Real 404 Status

A soft 404 happens when a page that doesn't exist still answers with a 200 OK status or redirects to the homepage, instead of returning a 404 Not Found. By the end of this guide, a made-up URL such as https://example.com/no-such-page-8472 will return a real 404 (or 410) status, while visitors still see a helpful error page.

By Updated ⏱ 30 minutes🎯 Intermediate● Medium impactTechnical
Illustration: Soft 404 pages fix guide
TECHNICAL · FIX GUIDE Soft 404 pages IMPACTEFFORT TIME30 minutes LEVELIntermediate

Why it matters

Search engines rely on the HTTP status code, not the words on the page, to decide whether a URL exists. If a missing page returns 200, Google spends crawl budget on junk URLs, flags them as "Soft 404" in Search Console, and may index thin "not found" pages under your brand. Redirecting every missing URL to the homepage hides broken links from you and confuses users who expected specific content.

AI crawlers and link checkers read the status code the same way, so dead URLs keep getting cited as if they were live.

✕Beforecurl -Ihttps://example.com/no-such-page-8472→ HTTP/2 200 (or 301/302 to the✓Aftercurl -Ihttps://example.com/no-such-page-8472→ HTTP/2 404, with a branded "Page not

What you need

Access to your server config, hosting dashboard or CMS admin
A terminal with curl, or browser DevTools (Network tab)
Permission to edit or disable redirect plugins and routing rules
Google Search Console access (for verification)

Step-by-step fix

1

Reproduce the problem with a made-up URL

Request a URL that cannot possibly exist and look only at the first status line. Don't follow redirects at this stage, because a 301 or 302 to the homepage is part of the problem. Note which of these you see:

  • 200: the server serves a page (often the homepage or an app shell) for any URL.
  • 301/302: something redirects missing URLs elsewhere.
  • 404/410: already correct for this path.
text
curl -I https://example.com/no-such-page-8472
# Also test a nested path and a fake file:
curl -I https://example.com/blog/no-such-post-8472
curl -I https://example.com/no-such-file-8472.html
Pro tip: Test a few path depths. Some sites return 404 at the root but 200 under /blog/ or /products/ because a different route template handles those sections.
2

Find what is catching unknown URLs

Soft 404s almost always come from one of these sources, so check them in this order:

  • A plugin or app set to "redirect all 404s to homepage".
  • A catch-all rewrite (e.g. everything rewritten to index.php or index.html with status 200).
  • A single-page app fallback that serves index.html for every path.
  • An Apache ErrorDocument pointing at a full URL, which forces a 302 redirect.
  • A dynamic template that renders "No results" or "Product not found" but never sets the status code.
Pro tip: Run curl -IL to see the full redirect chain. The Location header on the first response usually tells you which system issued the redirect.
3

Configure the web server to send a 404

On Nginx, make try_files end in =404 instead of falling back to the homepage or index file, and serve the error page internally so the status stays 404. html. html, Apache issues a redirect and the original URL never returns 404.

Reload the server after editing.

nginx
# Nginx (server block)
location / {
    try_files $uri $uri/ =404;
}
error_page 404 /404.html;
location = /404.html {
    internal;
}

# Apache (.htaccess or vhost)
ErrorDocument 404 /404.html
# NOT: ErrorDocument 404 https://example.com/404.html
Pro tip: Run nginx -t before systemctl reload nginx so a typo doesn't take the site down.
4

Set the status in your application or templates

If a CMS or app renders pages dynamically, the code that handles a missing record must set the status explicitly. Rendering an error message is not enough. In PHP, call http_response_code(404) before any output.

js App Router, call notFound(). In Express, register a final middleware that sets status 404. Apply the same treatment to empty category, search-tag and product templates that have nothing to show.

javascript
// Next.js App Router: app/blog/[slug]/page.tsx
import { notFound } from 'next/navigation';
export default async function Post({ params }) {
  const { slug } = await params;
  const post = await getPost(slug);
  if (!post) notFound(); // sends 404 and renders app/not-found.tsx
  return <Article post={post} />;
}

// Express: register last, after all routes
app.use((req, res) => {
  res.status(404).sendFile(path.join(__dirname, 'public/404.html'));
});

// PHP
http_response_code(404);
include __DIR__ . '/404.php';
exit;
Pro tip: In the Next.js Pages Router, return { notFound: true } from getStaticProps or getServerSideProps instead.
5

Remove blanket 404-to-homepage redirects

Disable any rule that sends every missing URL to the homepage or another generic page. Keep individual 301 redirects only where a specific old URL has a genuine replacement, such as /old-product to /new-product. Everything else should return 404, and Search Console will then show you real broken links to fix.

Pro tip: Before deleting a catch-all rule, export the list of URLs it was absorbing from your server logs. High-traffic ones deserve a proper one-to-one 301.
6

Use 410 for content you removed on purpose

For pages you deleted permanently, such as discontinued products or retired campaigns, a 410 Gone tells crawlers to drop the URL faster than a 404. Both statuses pass this check. Use 410 only for known removed URLs, and keep 404 as the default for everything else.

nginx
# Nginx
location = /spring-sale-2024 { return 410; }

# Apache (.htaccess)
Redirect gone /spring-sale-2024
7

Make the 404 page helpful without changing its status

Keep the error page useful for visitors: your normal header and navigation, a short "We couldn't find that page" message, a search box, and links to popular sections. Don't add a meta refresh or JavaScript redirect to the homepage. That turns the 404 back into a soft 404 for crawlers that render JavaScript.

html
<main>
  <h1>Page not found</h1>
  <p>The page you requested doesn't exist at Example Co. Try searching or start from a popular section.</p>
  <form action="/search" method="get"><input name="q" aria-label="Search"> <button>Search</button></form>
  <ul><li><a href="/">Home</a></li><li><a href="/products">Products</a></li><li><a href="/contact">Contact</a></li></ul>
</main>
Pro tip: Add <meta name="robots" content="noindex"> to the 404 template as a safety net in case it is ever served with the wrong status.
8

Re-test the made-up URL and real pages

Clear any CDN or page cache, then request a fresh random URL. The first response line must show 404 or 410 with no redirect. Also confirm that real pages still return 200, because an over-eager rule can break live URLs.

text
curl -I https://example.com/no-such-page-$RANDOM
# Expected: HTTP/2 404
curl -I https://example.com/
# Expected: HTTP/2 200
Pro tip: Use a new random path for each test so you aren't reading a cached response.

Platform-specific notes

WordPress

Core WordPress returns 404 correctly, so soft 404s usually come from plugins such as "404 to homepage" tools or a Redirection/Rank Math/Yoast rule that redirects all 404s. Disable those rules under Tools > Redirection, or under the SEO plugin's Redirections section. If your theme lacks a 404.php template, add one. Check that page builders don't override it with a 200 page.

Shopify

Shopify returns 404 for unknown URLs natively, and its URL redirects (Online Store > Navigation > URL Redirects) only fire for paths that would otherwise 404. If unknown URLs redirect to the homepage, an installed app is responsible. Check apps that advertise "fix broken links" or "redirect 404s" and turn off the global redirect option. Edit the error page in the theme's 404 template.

Next.js / Vercel

Add app/not-found.tsx and call notFound() wherever data lookups fail. A catch-all route like [...slug] that always renders content returns 200 for everything, so make it call notFound() for unknown slugs. Avoid a rewrite in vercel.json or next.config.js that sends every path to /.

Netlify / Cloudflare Pages (SPAs)

The common SPA rule "/* /index.html 200" in Netlify's _redirects makes every URL return 200. On Cloudflare Pages, if no 404.html exists, the project is treated as a SPA and serves index.html with 200. Add a top-level 404.html, and prerender or list real routes so that only known paths fall back to the app shell.

Wix / Squarespace

Both platforms return 404 for unknown URLs by default, and you can design the error page (Wix: Pages > 404 Error Page; Squarespace: Settings > Advanced > 404 Page). Soft 404s here usually come from a site-wide redirect rule. In Wix, check SEO > URL Redirect Manager; in Squarespace, check Settings > Developer Tools > URL Mappings. Remove any wildcard rule pointing to the homepage.

Check that it worked

✅ How to verify

  • Run curl -I on a random non-existent URL. The first status line must read 404 or 410, with no Location header.
  • Open DevTools > Network in Chrome, load a fake URL, and check that the document request shows status 404 (enable "Preserve log" so redirects aren't hidden).
  • In Google Search Console, run URL Inspection > Test Live URL on a fake URL and confirm it reports "Not found (404)", then watch Pages > "Soft 404" decline over the following weeks.
  • Re-run the site audit and confirm the check reports that unknown URLs correctly return 404 or 410.

⚠️ Common mistakes

  • Redirecting every missing URL to the homepage with a 301 or 302. Google treats this as a soft 404, and the original URL still never returns 404.
  • Pointing Apache's ErrorDocument at a full https:// URL, which turns every error into a 302 redirect.
  • Showing a "Not found" message from JavaScript in a single-page app while the server still sends 200 for the shell.
  • Testing a URL that is cached at the CDN from before the fix, then assuming nothing changed (or that it's fixed when it isn't).

Is this still an issue on your site? Run a free audit — ZORO checks this and 294 other SEO, AI-visibility, accessibility and security signals, with fixes for your platform.

Check my site free

FAQ

What is a soft 404 error?

It's a URL that tells the visitor the page doesn't exist, or shows little or no content, but returns a 200 OK status or redirects elsewhere instead of returning 404 or 410. Search engines detect the mismatch and label it a soft 404.

Should I redirect 404 pages to my homepage?

No. Redirect only specific old URLs that have a close replacement. Blanket homepage redirects are treated as soft 404s, frustrate users, and hide broken links you should fix.

Is 404 or 410 better for SEO?

Both remove the URL from the index. A 410 signals intentional, permanent removal and is often dropped slightly faster, so use it for content you deleted on purpose. Use 404 as the default for unknown URLs.

Will returning more 404s hurt my rankings?

No. Google states that 404s for URLs that shouldn't exist are normal and don't harm a site's rankings. Fixing soft 404s actually helps, because crawl budget goes to real pages instead of junk URLs.