Skip to content

Troubleshooting guide

404 Not Found: how to find and fix broken pages

A 404 means the server worked correctly but found nothing at that address. The error is not the problem. A 404 on a page people still reach is.

4 min read10 sectionsUpdated

On this page

Key points

  • A real 404 for a page that never existed is correct and harmless.
  • Redirect only pages that moved to a genuinely equivalent page.
  • Soft 404s, error pages returning 200, are the worse bug.
  • Your own broken internal links are the 404s worth fixing first.

When a 404 matters

Every public site gets 404s from bots probing for /wp-admin and old URLs. Those cost nothing. The 404s worth your time are ones reached from your own links, from external sites linking to pages you moved, or from a deployment that dropped a route.

Use 410 Gone rather than 404 when a page was removed deliberately and will not return, as it states your intent more clearly.

Common causes

  • A page moved without a redirect after a redesign or CMS migration.
  • Case-sensitive paths. /About and /about are different on Linux but the same on a developer's Mac, so the bug appears only in production.
  • Trailing slash mismatch between the links and the router.
  • Missing build assets. A new deployment removed hashed JavaScript files that cached pages still request.
  • Reverse proxy path rewriting that strips or adds a prefix.

Find the 404s that matter

Your access log shows which missing URLs get real traffic. Sort by count and look at the referrer to see who is linking there.

bash
# Top missing paths in an Nginx access log
awk '$9 == 404 {print $7}' /var/log/nginx/access.log | sort | uniq -c | sort -rn | head -20

# Where do those requests come from?
awk '$9 == 404 {print $11}' /var/log/nginx/access.log | sort | uniq -c | sort -rn | head -20

# Detect a soft 404: a missing URL must not return 200
curl -s -o /dev/null -w "%{http_code}\n" https://example.com/this-does-not-exist-xyz

Fixes

Redirect moved pages with a 301 to the closest equivalent. Sending every 404 to the home page is treated by Google as a soft 404 and helps nobody. Fix broken internal links at the source, since a redirect hop is a workaround. Keep old hashed assets available for a while after each deployment, so open tabs do not fail. Serve a useful 404 page with search and top links, and make sure it really returns status 404.

Catch it automatically

Add uptime checks on your most valuable pages that verify both the status and a keyword in the body, because a keyword check also catches a soft 404. For assets that vanish after a release, real-user monitoring shows failed resource loads from real browsers. Google Search Console's page indexing report lists what Googlebot could not find.

Frequently asked questions

Do 404 errors hurt SEO?

Not by themselves. Google expects them. They matter when valuable pages with links or traffic disappear without a redirect, or when your own navigation points at them.

Should I redirect all 404s to my home page?

No. Google treats such redirects as soft 404s and visitors land somewhere irrelevant. Redirect only to a truly equivalent page.

What is a soft 404?

A page that says it was not found but returns status 200. Search engines may index it, and monitoring reports it as healthy.

Check it now, free

Watch your own site and services with VitalRix

Uptime checks, APM, logs, real-user monitoring, alerts and status pages in one place. Every product has a free tier and no credit card is needed.