How to Fix Old URLs That Return 404 After a Redesign

After a redesign or platform migration, URLs that existed for years often stop working and return 404 Not Found. This guide shows you how to pull your old URLs from the Internet Archive, find the ones that are now dead, map each to its closest new page and set up permanent 301 redirects so the dead share falls well below one in five.

By Updated ⏱ 2-4 hours for a typical site🎯 Intermediate● High impactTechnical
Illustration: Old URLs return 404 after a redesign fix guide
TECHNICAL · FIX GUIDE Old URLs return 404 after a redes… IMPACTEFFORT TIME2-4 hours for a typical site LEVELIntermediate

Why it matters

Every old URL that returns 404 throws away the backlinks pointing to it, the rankings it held and the visitors who bookmarked it or click it from old emails, forums and AI answers that still cite it. Google drops 404 pages from the index over time, and the link equity they collected does not pass to your new pages. A 301 redirect passes most of that value to the replacement page and sends users and crawlers somewhere useful instead of a dead end.

✕Beforehttps://example.com/services/web-design.html(archived in 2022 and linked from 40✓Afterhttps://example.com/services/web-design.htmlreturns 301 Moved Permanently to

What you need

A list of your site's old URLs (Internet Archive CDX API, Google Search Console, backlink tool)
A terminal with curl, or a crawler such as Screaming Frog in List mode
Access to your redirect settings: server config, CMS redirect manager or CDN rules
A spreadsheet for the old-to-new redirect map

Step-by-step fix

1

Export your old URLs from the Internet Archive

The Wayback Machine's CDX API lists every URL it has captured on your domain. Request only captures that returned 200 at the time and collapse duplicates so each URL appears once. Save the output as old-urls.txt, then remove obvious noise such as tracking parameters, /wp-json/ endpoints, feeds and image files you don't care about.

text
curl -s "https://web.archive.org/cdx/search/cdx?url=example.com/*&fl=original&filter=statuscode:200&collapse=urlkey&limit=50000" > old-urls.txt

# Include the www host too if you used it before
curl -s "https://web.archive.org/cdx/search/cdx?url=www.example.com/*&fl=original&filter=statuscode:200&collapse=urlkey&limit=50000" >> old-urls.txt
Pro tip: Add &filter=mimetype:text/html to keep only pages and skip CSS, JS and images.
2

Add URLs that still have links or traffic

The archive misses some pages, so merge in other sources before prioritising:

  • Google Search Console > Indexing > Pages > Not found (404) > export
  • Your backlink tool's Best by links or Broken backlinks report (Ahrefs, Semrush, Moz)
  • GA4 > Reports > Engagement > Landing page for the months before the redesign

Mark URLs that have backlinks or past traffic as top priority; those are the ones losing value right now.

Pro tip: Old XML sitemaps saved in the Wayback Machine (example.com/sitemap.xml) are a quick way to recover the full pre-redesign URL list.
3

Check the current status of every old URL

Request each URL and record the status code it returns today. Anything returning 404 or 410 is dead and counts against you; 301/308 followed by 200 is fixed. Run it without following redirects first, then with -L to catch redirects that land on a 404.

text
while read -r u; do
  first=$(curl -s -o /dev/null -w "%{http_code}" "$u")
  final=$(curl -s -o /dev/null -L -w "%{http_code} %{url_effective}" "$u")
  echo "$u,$first,$final"
done < old-urls.txt > url-status.csv

grep -E ",(404|410)|,[0-9]{3},(404|410)" url-status.csv
Pro tip: In Screaming Frog, use Mode > List, paste the URLs and enable Configuration > Spider > Advanced > Always Follow Redirects.
4

Build an old-to-new redirect map

In a spreadsheet, put each dead URL in column A and its closest equivalent new URL in column B: the same product, the same article, or the most specific category that covers the topic. Don't send everything to the homepage; Google treats mass homepage redirects as soft 404s and passes no value. Only leave a URL without a target if the content is truly gone and nothing related exists.

text
old_url,new_url
/services/web-design.html,/services/website-design/
/blog/2021/05/seo-checklist/,/blog/seo-checklist/
/products.php?id=118,/shop/oak-desk/
/about-us.html,/about/
Pro tip: Look for patterns (e.g. every /blog/YYYY/MM/slug/ became /blog/slug/) so one rule can fix hundreds of URLs.
5

Add 301 redirects on your server

Implement the map as permanent (301 or 308) redirects pointing straight to the final URL with no chains. On Nginx, a map block keeps hundreds of one-to-one redirects fast and readable; put the map in the http context and the check inside your server block. Reload with nginx -t && systemctl reload nginx.

nginx
# /etc/nginx/conf.d/redirects.conf (http context)
map $uri $new_uri {
    /services/web-design.html   /services/website-design/;
    /about-us.html              /about/;
    ~^/blog/\d{4}/\d{2}/(?<slug>[^/]+)/?$  /blog/$slug/;
}

# inside server { }
if ($new_uri) {
    return 301 $new_uri;
}
Pro tip: Query-string URLs like /products.php?id=118 need matching on $request_uri or $arg_id, because $uri excludes the query string.
6

Use Apache rules if you're on Apache hosting

In .htaccess or the vhost, use Redirect 301 for single URLs and RedirectMatch 301 for patterns. Put specific rules above pattern rules so they win. For query-string URLs you need mod_rewrite with a RewriteCond on %{QUERY_STRING}.

apache
Redirect 301 /services/web-design.html https://example.com/services/website-design/
Redirect 301 /about-us.html https://example.com/about/
RedirectMatch 301 ^/blog/\d{4}/\d{2}/([^/]+)/?$ https://example.com/blog/$1/

RewriteEngine On
RewriteCond %{QUERY_STRING} ^id=118$
RewriteRule ^products\.php$ https://example.com/shop/oak-desk/? [R=301,L]
Pro tip: The trailing ? in the RewriteRule target strips the old query string from the new URL.
7

Re-test every old URL and fix leftovers

Run the status script from step 3 again against the full list. Every redirected URL should return 301 or 308 on the first hop and 200 at the final URL in one hop. Aim for zero 404/410s on URLs with links or traffic; the audit fails if 20% or more of the archived URLs are dead, and it counts 410 the same as 404.

text
curl -sI https://example.com/services/web-design.html | grep -iE "^(HTTP|location)"
# HTTP/2 301
# location: https://example.com/services/website-design/
Pro tip: Watch for redirects to URLs that themselves redirect (chains) and update the map so each points to the final destination.

Platform-specific notes

WordPress

Install the free Redirection plugin and use Tools > Redirection > Add new, or Tools > Redirection > Import/Export to upload your CSV map. Rank Math (Rank Math SEO > Redirections) and Yoast SEO Premium (Yoast SEO > Redirects) do the same. The plugin's 404 log shows old URLs still being hit.

Shopify

Go to Online Store > Navigation > View URL redirects (or search 'URL redirects' in the admin) and use Import to upload a CSV with 'Redirect from' and 'Redirect to' columns. Shopify only applies a redirect when the old path would otherwise 404, and it cannot redirect URLs under /products/ that still exist. Old /collections/all?page= style URLs need separate entries.

Wix

Open the dashboard and go to Marketing & SEO > SEO > Tools and settings > URL Redirect Manager. Add redirects individually or use Import CSV. Wix supports wildcard-style folder redirects for moving whole sections.

Webflow

Go to Site settings > Publishing > 301 redirects, enter the old path and the new path, then republish. Use %1-style capture groups with regex patterns, e.g. old path /blog/(.*) and redirect to /articles/%1.

Next.js / Vercel

Return redirects from the async redirects() function in next.config.js with permanent: true, which sends a 308 (treated like a 301 by Google). Vercel caps the number of config redirects, so very large maps are better handled in middleware reading a JSON map or with Vercel's bulk redirects.

Check that it worked

✅ How to verify

  • Run the curl status loop again on the full old-urls.txt list and confirm no URL with backlinks or past traffic returns 404 or 410.
  • Open several old URLs from web.archive.org in a browser and check they land on the correct new page in a single hop.
  • In Google Search Console, select the dead URLs under Indexing > Pages > Not found (404) and click Validate fix; the count should fall over the following weeks.
  • Re-run the audit and confirm the share of dead archived URLs is well under 20%.

⚠️ Common mistakes

  • Redirecting every old URL to the homepage, which Google treats as a soft 404 so no link value is passed.
  • Using 302 or JavaScript/meta refresh redirects instead of a server-side 301 or 308.
  • Returning 410 for pages that still have backlinks; 410 is counted as dead just like 404, so redirect them to a related page instead.
  • Creating redirect chains (old > interim > new) or loops when the URL structure changed more than once.

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

How long should I keep 301 redirects after a redesign?

Keep them for at least a year, and indefinitely for URLs with backlinks. Google says a year is usually enough for signals to transfer, but external links and bookmarks keep sending visitors to the old URL long after that.

Do I need to redirect every old URL from the Wayback Machine?

No. Prioritise URLs with backlinks, past organic traffic or Search Console impressions. Low-value pages such as old tag archives or test pages can return 404, as long as the dead share stays small and nothing important is lost.

Is a 404 or a 410 better for pages I deleted on purpose?

A 410 tells Google the page is permanently gone and may drop it slightly faster, but both lose any links pointing to the page. If a related page exists, a 301 to it is better than either.

Will 301 redirects lose my rankings?

A 301 to a closely matching page passes nearly all ranking signals; Google confirms 301s do not lose PageRank. Rankings drop when the target page is unrelated or when the old URL returns 404.