Tutorial · migration-hosting · Published 2026-08-15 · 3 min read

Building a redirect map for a site move

Building a redirect map for migration: capture all old URLs, assign one 301 target each and test the full set before the swap.

What a redirect map is

A redirect map is the complete list of old URL to new URL pairs you will serve after a URL migration. Its two rules are absolute:

  1. Every old URL appears exactly once as a source.
  2. Every source has exactly one target, and the target is a real new page, not a loop and not the root when a closer page exists.

The map is the raw material of every redirect mechanism. Import it verbatim into your host panel or your server config, and the site starts answering old URLs correctly the moment the migration flips.

Building the map from the old site

  1. Export the full old URL list (crawler or sitemap).
  2. For each URL, look up its new home. Three cases, one rule (from URL migration planning):
Old URLNew URLHow to decide
/blog/2024/cat-health//guides/cat-health/one-to-one if the page lives on
/blog/2024/ and /blog/2024/cat-stories//guides/consolidated for thin pages
/archive/orphan//fallback only when nothing closer exists
  1. Write the map as a file with two columns: old,new (CSV is the format search-friendly hosts accept, but any two-column list works before it is imported).

Common map mistakes

Verifying a redirect map

  1. After import, run a head-request loop over the old URLs: each must return 301, with a Location header equal to the mapped target and no redirect loop.
  2. Confirm status is 301 and not 302, satisfying the redirect contract.
  3. Spot-check the targets resolve to 200 and to the content you expect (a 301 to a soft-404 is still a 404 for the user).

When the map is bigger than one file

A large site (hundreds of pages) needs the map imported into the server or CMS in chunks, and then re-checked in those same chunks, because a single bad row in a batch import usually kills the import. Keep the export sorted so missing rows are visible during review. The map becomes the single source of truth that a post-migration 404 sweep in the indexing analysis workflow verifies against.

Need a website built, fixed, optimised, migrated or replaced?

This technical resource is written by CSMBAC, a small design and development studio. If you would rather hand the problem to a professional, the website service page explains how we build enquiry-ready websites.

Explore website services