SEO2 min read
How to build a 301 redirect map for a site migration
The redirect map is where migrations win or lose search traffic. A step-by-step method, with the most common mistakes.
Mitja PakFounder & developer, builds Webflow sites every dayA redirect map is a two-column sheet: old URL, new URL. It's simple to describe and tedious to get right. It's also where most post-migration traffic loss comes from, so do it properly.
Step 1: collect every old URL
No single source has them all. Combine these, then remove duplicates.
- A full crawl of the live site
- The XML sitemap
- Search Console pages with impressions in the last 12 months
- Analytics landing pages for the same period
- Backlink exports from Ahrefs, Semrush, or Search Console's links report
The backlink list matters more than people think. It catches old URLs that are no longer linked internally but still have links from other sites.
Step 2: decide what happens to each URL
| Decision | When | Result |
|---|---|---|
| Keep | The page moves with the same path | No redirect needed |
| Move | Same content, new path | 301 to the new URL |
| Merge | Thin or overlapping pages | 301 to the page that replaces them |
| Retire | No traffic, no links, no replacement | 410 or 404 |
Avoid sending retired pages to the homepage in bulk. Search engines tend to treat that as a soft 404, so you lose the value anyway, and visitors land somewhere confusing.
Step 3: match old to new
Start with patterns. If every blog post moves from /post/slug to /blog/slug, one rule covers hundreds of rows. Then handle the exceptions by hand, sorted by traffic, so the most valuable pages get the most attention.
Step 4: implement at the edge
Put redirects as close to the visitor as possible. For a handful of rules, the framework's config works: Next.js has a redirects option, Astro has one too. For hundreds or thousands, use your host's bulk redirect feature or a lookup in middleware, so you don't slow every request.
Step 5: test every row
- 01Run the whole map against staging with a script or a crawler in list mode
- 02Each old URL should return exactly one 301, then a 200
- 03Fix chains, where an old URL redirects to another redirect
- 04Fix loops and redirects to 404 pages
- 05Update internal links to point straight at new URLs
Common mistakes
- Forgetting trailing slash and uppercase variants
- Losing query parameters that campaigns depend on
- Using 302s for permanent moves
- Leaving old chains from previous migrations in place
- Deleting the redirect rules a year later during a cleanup
- Webflow migration to Next.js or Astro →Collections, interactions, localization
- WordPress migration to Next.js or Astro →Fewer plugins, or WordPress kept headless
Planning a migration?
See the assessment →