← Blog · By Mars LLC editorial team · October 4, 2026 · Editorial standards

How to find and fix 404s (and when to redirect)

Find broken URLs, decide between a 301 and a 404, avoid redirect chains, and generate the rules.

404s waste budget and frustrate users. The fix is usually a redirect — but not always, and doing it wrong is worse than leaving it.

Find them

  • Check the Pages report in Search Console for 404s Google found
  • Watch your server logs for repeated 404 hits
  • Crawl your own site periodically and extract links
  • Check Search Console → Links → Top linked pages for broken targets

Redirect or let it 404?

  • Redirect (301) when the content moved or a close equivalent exists
  • Let it 404/410 when the content is gone with no replacement — a 404 is better than a redirect to something unrelated
  • 410 signals "gone permanently" and can be deindexed faster than 404 in some cases

Avoid chains and loops

Point redirects directly to the final destination. Chains (A → B → C) dilute signals and slow users down.

  • Audit for chains: each redirect should have one hop
  • Never redirect A → B and B → A
  • Never redirect to a 404

The mechanics

  • Apache: Redirect 301 /old /new
  • Nginx: return 301 /new; inside a location block
  • Most CMSs and hosts have a redirect UI
  • Next.js: redirects() in next.config.js

Nginx example

location = /old-page {
  return 301 /new-page;
}

Apache example

Redirect 301 /old-page /new-page

Where redirects matter most

  • Site migrations (domain, CMS, URL structure)
  • Product/category renames in e-commerce
  • Blog slug changes
  • Removing seasonal or discontinued pages

Worked example

After moving a blog from /2023/03/seo-tips to /blog/seo-tips, you add a single 301 from the old URL to the new one, update internal links to point at the new URL, and submit the new URL for indexing. Do not create a chain through an intermediate slug.

How to verify

  • curl -I https://example.com/old should return 301 with the right Location
  • Follow it: curl -IL should end at 200
  • Search Console → Pages should show the old URL as "Page with redirect"

Generate the rules

Use the free redirect generator to turn a list of old → new URLs into ready 301/302 rules for nginx or Apache, and clean up internal links with the link extractor.

Try the free tool

Turn a list of old → new URLs into 301/302 redirect rules for nginx and Apache.

Open Redirect Rules Generator