Skip to content

When the old site is already broken: rebuilding a redirect map from the Wayback Machine

When an old site is already broken, a crawl finds little or nothing, but the Wayback Machine's index may still hold its list of pages. This is how we rebuilt one for a two-office interventional pain practice in the Houston area.

Most advice on how to find all URLs on a website assumes the site still works. You run a crawler, a program that follows every link on the site, or you download the site's sitemap. For one old domain of the pain practice we rebuilt, neither was possible. Its registrar, the company that holds the domain's registration, forwarded the home page and nothing else. A link to any deeper page had nowhere to land.

We still needed those old addresses. Any of them could sit in a patient's bookmarks or in a link on another website, and each one needed a redirect to the right page on the new site. The list came from an April 2024 copy of the domain's sitemap, saved by the Internet Archive's Wayback Machine.

This is the method, written so a practice administrator can follow it or check someone else's work. Building the list of old addresses is the first step of our website migration services. The rest of that project is in how we merged the practice's three domains into one.

What a 301 redirect map is

A 301 redirect map is a list of pairs. Each pair is an old address and the new page that replaced it. Your web server reads the list, and when anyone asks for an old address, it answers with a 301 and the new address. Google says the 301 and 308 codes "mean that a page has permanently moved to a new location" (Redirects and Google Search).

Writing the pairs is the easy half. A map can only cover the addresses someone found, so the list is the real work.

Why the usual ways to find old URLs come up empty

Google's guide to site moves lists where to look for old addresses: your sitemaps, the links report in Search Console, your server logs, your analytics and your content management system. Each one needs the old site still running, or an account someone set up while it was.

When the old site is gone, most of those go with it. The forwarding domain had no sitemap left to download and no pages for a crawler to follow. What it did have was a history in the Wayback Machine.

How to find old pages of a website in the Wayback Machine

The Internet Archive's Wayback Machine keeps saved copies of public web pages. To look around, type an old domain into the search box at web.archive.org and pick a date. That's fine for checking a few pages. For a full list, go to the index behind it.

That index is the CDX index. The Internet Archive's page on its Wayback Machine APIs describes the CDX server as an API "which allows for complex querying, filtering and analysis of Wayback capture data." The server's technical documentation says it "serves the index that the wayback machine uses to lookup captures."

A capture is one saved copy of one address at one moment. You can query the index from your browser's address bar. Each line of the answer is one capture: the address, when it was saved, the type of file and the status code the site sent back that day, plus a few technical fields you can skip.

Rebuilding the list, step by step

1. Look for an archived sitemap

A sitemap is a file where a site lists its pages for search engines (Google's overview of sitemaps). If the archive saved one, you have the site's own list of its pages on that date.

Paste this into the address bar, with your old domain in place of example.com:

https://web.archive.org/cdx/search/cdx?url=example.com/sitemap.xml

Each line that comes back is one saved copy. For the forwarding domain there was exactly one, from April 5, 2024. To open a copy, go to https://web.archive.org/web/*/example.com/sitemap.xml and click its date. Copy every address it lists into a spreadsheet, one per row.

Then try the other names a sitemap can have. When we checked our work on the practice's other old domain, which ran WordPress, we also tried sitemap_index.xml, page-sitemap.xml and post-sitemap.xml. The archive had saved none of them.

2. Without a sitemap, list every archived address

Ask the index for every address on the domain, one line each:

https://web.archive.org/cdx/search/cdx?url=example.com/&matchType=prefix&collapse=urlkey

In that query, matchType=prefix asks for every address that starts with what you typed. The collapse=urlkey part keeps one line per address instead of one per saved copy. Both settings are in the Internet Archive's documentation. If the index answers with an error page, wait a few minutes and run it again.

When we ran this for the WordPress domain in October 2026, it returned 258 addresses, and most weren't pages. Of the 258, 164 were tag, category, author and page-two listings from the old blog, and 13 were theme and system files. The rest were the real pages and blog posts, and those are what you map.

3. Add what the archive never saved

The archive has gaps. Of the 53 posts on the old WordPress blog, it had saved 39. Ten page addresses in our redirect map had never been saved at all. So we tested both lists together: every page the archive had, plus every address in the map that it didn't.

Other places hold addresses the archive missed:

  • the final URLs in your ad account
  • the website field on old Business Profiles and directory listings
  • printed materials and email templates
  • the links report in Search Console, if the old domain was ever set up there

4. Map each address to its closest page

Each old address goes to the one new page that replaced it. A section page is the fallback when nothing closer exists, and the home page is the last resort. Google's guide warns against sending "many old URLs to one irrelevant single URL destination, such as the home page of the new site."

Old blog listing pages can share a destination, because the new blog page does the same job. That's where the 164 listing pages from the WordPress domain go.

Next to each old address, add a column for its new page and one for the date and result of its last test. That spreadsheet is your redirect map.

5. Test every address, one at a time

Request each old address and follow every redirect to the end. A free command-line tool called curl does this, and a short script can run it down the whole list. A good result is one or more permanent redirects (301 or 308), then a 200, which means the page loaded. When a direct redirect isn't possible, Google's guide suggests keeping the chain to "ideally no more than 3" redirects.

Watch for four kinds of failure: an error page at the end, a loop that never ends, a long chain of hops, and a landing on the home page when a better page exists. Test every address on the list, including the ones a general rule is supposed to cover. And go slowly. A burst of requests can trip a site's firewall and make a good address look broken.

We tested 345 of the practice's old addresses on October 13, 2026. None got stuck in a redirect loop, and the longest chain was 3 redirects. But 21 old blog posts from the archived sitemap ended on an error page: a general rule had sent them to pages that didn't exist. So we gave each one its own redirect. On October 15, all 149 addresses in our map ended on a live page.

What the archive can't tell you

An archived sitemap is a snapshot. Ours was from April 2024, so a page added after that date wouldn't be on it. The archive also only knows the addresses it saved. Treat its list as the minimum and add everything else you can find.

What to do this week

  1. List every domain your practice has used, including any that now just forward somewhere.
  2. For each one, type the domain plus the path of a page that used to exist, and see where you land. If it's the home page or an error, that domain's old addresses aren't being carried over.
  3. Run the sitemap query above for each old domain and save what comes back.
  4. Ask whoever built your current site for the redirect map and the date it was last tested.

Tell us about your business

We make you the obvious choice (start a project)

We reply within one business day.

Or email hello@custosstudio.com