In short
The redirect map is the table that states, for every URL of the old site, what becomes of it: kept, 301-redirected to a specific address, or removed with a 410. Comprehensive means that no URL known to search engines, external links or visitors is forgotten, including images, PDFs and old addresses that are already redirected. Once the task is done, you have a file validated by check formulas and converted to the format your server, CDN or CMS expects.
Why it matters
After a redesign, every forgotten old URL returns a 404. Search engines eventually drop it from the index, its external links lead to a dead end, and visitors coming from a bookmark, an email or an AI assistant's answer land on an error. Traffic losses after a migration most often come from this: not from a bad redirect, but from a missing one.
Google recommends drawing up the list of old URLs, starting with the most important ones, then deciding where each one should redirect. It names as sources the sitemaps, the most visited pages in the server logs or the analytics tool, the Search Console Links report and the list of content in the CMS. It also reminds you not to forget the files embedded in pages: images, videos, JavaScript and CSS.
No single source is enough. The crawl does not see orphan pages; the sitemap often leaves out PDFs; Search Console only shows pages that had impressions; backlink tools only see linked pages. It is their union that makes the map comprehensive.
What it improves
- Organic traffic Pages that ranked pass their signals on to their new address instead of disappearing.
- External links Backlinks to old URLs keep working.
- AI citations and bookmarks URLs already cited or shared lead to the right content.
- Migration quality Chains, loops and mass redirects to the home page are detected in the spreadsheet, before launch.
- Rankings No gain; the map limits the loss and the fluctuation Google warns about during a site move.
How to check
A compliant map passes these checks:
- All the URLs from the exports made before the redesign (crawl, sitemaps, Search Console, analytics, backlinks, logs) appear in the map, with no duplicates.
- Every row has a decision: keep, 301 or 308 to a URL, 410.
- No target is itself a source URL (chain), and no source is its own target (loop).
- Every target exists on the new site and will return 200 there.
- No more than a handful of rows point to the home page, and each one is justified.
The formulas in step 5 automate checks 1 to 4. Checking the server's actual responses comes next, with the test redirects (opens in a new tab) task.
How to implement
Step 1 — Gather all the old URLs
Create one tab per source, with the URL in column A:
| Source | How to get it |
|---|---|
| Full crawl | Export of the pre-redesign crawl (opens in a new tab): pages, images, PDFs, CSS, JavaScript, existing redirects |
| Sitemaps | All the <loc> URLs of the current sitemaps, indexes included |
| Search Console | Pages tab of the Performance report over 16 months; Links report, Top linked pages table |
| Analytics | Landing page report over 12 months, all sources combined |
| Backlinks | Target URLs from the backlink export (opens in a new tab) |
| Server logs | Paths requested over 12 months, to capture seasonal and orphan pages |
| CMS | List of published content, media included |
| Web archive | Historical URLs captured by the Wayback Machine |
| Existing redirects | .htaccess, Nginx configuration, redirect plugin, CDN rules |
Exports from the Search Console interface are limited to 1,000 rows per report: beyond that, use the Search Analytics API, bulk data export to BigQuery or Looker Studio.
Useful commands:
# URLs from a sitemap (repeat for each sitemap listed in the index)
curl -s https://www.example.com/sitemap.xml | grep -oE '<loc>[^<]+</loc>' | sed -E 's#</?loc>##g' > sitemap.txt
# Paths successfully requested in a combined-format log (Apache or Nginx)
awk '$9 == 200 {print $7}' access.log | sort | uniq -c | sort -rn > logs.txt
# Unique URLs archived by the Wayback Machine
curl -s "https://web.archive.org/cdx/search/cdx?url=example.com/*&fl=original&collapse=urlkey&filter=statuscode:200" > archive.txt
# Published content of a WordPress site, with WP-CLI
wp post list --post_type=post,page,product --post_status=publish --field=url > cms.txt
Good to know: redirects already in place are part of the map. If
/aredirected to/band/bchanges in turn,/amust now point directly to the new target, otherwise the redesign creates a chain. See fix redirect chains (opens in a new tab).
Step 2 — Normalize and deduplicate
Before merging the tabs, write every URL in the same form, otherwise the matching fails:
- Relative path (
/blog/article/) rather than a full URL, unless the domain changes. - Parameters: remove tracking parameters (
utm_*,gclid,fbclid); keep those that identify content (?id=42from an old CMS). - Host and protocol variants (
http://, non-www): they fall under a single global rule, not one row per URL. See standardize HTTP/HTTPS and www/non-www (opens in a new tab).
In Google Sheets:
Remove the domain:
=REGEXREPLACE(A2,"^https?://[^/]+","")
Remove tracking parameters:
=REGEXREPLACE(B2,"[?&](utm_[a-z]+|gclid|fbclid)=[^&]*","")
Merged unique list (Plan tab, cell B2):
=UNIQUE({Crawl!B2:B;Sitemaps!B2:B;GSC!B2:B;GA4!B2:B;Backlinks!B2:B;Logs!B2:B;Archive!B2:B})
Empty ranges in between produce a blank row at the top or bottom of the list: delete it.
Step 3 — Create the decision table
Plan tab, one row per old URL:
| A · ID | B · Old URL | C · Type | D · Clicks, 12 months | E · Referring domains | F · Priority | G · Decision | H · New URL | I · Reason | J · Tested | K · Owner |
|---|---|---|---|---|---|---|---|---|---|---|
| R001 | /guides/detartrer-chauffe-eau/ |
Page | 4,200 | 18 | 1 | Keep | /guides/detartrer-chauffe-eau/ |
URL unchanged | Léa | |
| R002 | /produits/the-vert-sencha.html |
Page | 1,900 | 3 | 1 | 301 | /thes/the-vert/sencha/ |
New site structure | Marc | |
| R003 | /tarifs-pro/ |
Page | 300 | 1 | 2 | 301 | /tarifs/ |
Merged with the Pricing page | Marc | |
| R004 | /promo-noel-2023/ |
Page | 0 | 0 | 3 | 410 | Campaign over, no equivalent | Léa | ||
| R005 | /docs/catalogue-2025.pdf |
40 | 2 | 2 | 301 | /docs/catalogue-2026.pdf |
New edition | Paul |
Fictional values. Enforce drop-down lists for Type (Page, Image, PDF, File, Category, Parameter) and Decision (Keep, 301, 308, 410). Columns D and E are filled in with VLOOKUP from the source tabs; the priority follows from them (1: traffic, links or revenue; 2: a few signals; 3: no signal).
Choosing the target is the subject of the next task: map old URLs to relevant equivalents (opens in a new tab). Handle priority 1 first, one by one; priority 3 can be covered by pattern rules.
Step 4 — Write the pattern rules
When a whole section changes path without changing slugs, one rule replaces hundreds of rows: /actualites/(.*) to /blog/$1. Record these rules in a Motifs tab, with an example of a URL covered. Exact rules (one URL to one URL) must apply before pattern rules.
Step 5 — Add the check formulas
Enter these in row 2 of the Plan tab, then fill them down; the Nouveau tab contains the URLs from the staging crawl in column A:
Duplicate source:
=IF(COUNTIF($B$2:$B,B2)>1,"Duplicate","")
Missing decision:
=IF(G2="","No decision",IF(AND(OR(G2="301",G2="308"),H2=""),"Missing target",""))
Loop:
=IF(AND(H2<>"",G2<>"Keep",B2=H2),"Loop","")
Chain (the target is itself redirected):
=IF(AND(H2<>"",H2<>B2,COUNTIFS($B$2:$B,H2,$G$2:$G,"<>Keep")>0),"Chain","")
Target missing from the new site:
=IF(AND(H2<>"",COUNTIF(Nouveau!$A:$A,H2)=0),"Unknown target","")
And, once, the number of redirects to the home page: =COUNTIF($H$2:$H,"/"). In French-language Excel: SI, NB.SI, NB.SI.ENS, ET, OU.
Step 6 — Generate the file for the server
Export the Plan tab as CSV (plan.csv, comma separator, header in the first row), then produce every format in one go with this dependency-free Python script:
import csv
import json
DOMAINE = "https://www.example.com"
lignes = []
with open("plan.csv", newline="", encoding="utf-8") as fichier:
for ligne in csv.DictReader(fichier):
if ligne["Decision"] in ("301", "308"):
lignes.append((ligne["Old URL"], ligne["New URL"], ligne["Decision"]))
with open("nginx-map.conf", "w") as f:
for ancienne, nouvelle, code in lignes:
f.write(f" {ancienne} {DOMAINE}{nouvelle};\n")
with open("apache-rewritemap.txt", "w") as f:
for ancienne, nouvelle, code in lignes:
f.write(f"{ancienne} {DOMAINE}{nouvelle}\n")
with open("cloudflare-bulk.csv", "w") as f:
for ancienne, nouvelle, code in lignes:
f.write(f"{DOMAINE.removeprefix('https://')}{ancienne},{DOMAINE}{nouvelle},{code}\n")
with open("wordpress-redirection.csv", "w") as f:
for ancienne, nouvelle, code in lignes:
f.write(f"{ancienne},{nouvelle},0,{code}\n")
with open("netlify-redirects.txt", "w") as f:
for ancienne, nouvelle, code in lignes:
f.write(f"{ancienne} {nouvelle} {code}\n")
with open("vercel-redirects.json", "w") as f:
json.dump({"redirects": [
{"source": a, "destination": n, "statusCode": int(c)} for a, n, c in lignes
]}, f, indent=2, ensure_ascii=False)
URLs containing spaces or special characters must be encoded (%20) the same way browsers request them. The following sections explain where to put each file; the detailed syntax for each environment is in use 301/308 for permanent moves (opens in a new tab).
Apache
Versions Apache 2.4.
Copy apache-rewritemap.txt to /etc/apache2/redirections.txt and declare the RewriteMap in the virtual host (it is not allowed in a .htaccess file). For tens of thousands of rows, convert the file into a DBM table with httxt2dbm -i redirections.txt -o redirections.map and declare it as dbm:.
Nginx
Versions Nginx 1.24 and later.
Put the contents of nginx-map.conf into a map $uri $nouvelle_url { default ""; … } block in the http context. Beyond a few thousand entries, Nginx may ask you to increase map_hash_bucket_size or map_hash_max_size: the error message from nginx -t says so.
Cloudflare
Versions Cloudflare dashboard, all plans, November 2026.
Import cloudflare-bulk.csv into a Bulk Redirects list, then enable it with a rule. The file must not contain a header row. The number of URLs per list depends on the plan: check it in the documentation before importing a large map.
WordPress
Versions WordPress 6.4 and later, Redirection plugin 5.
In Tools > Redirection, Import/Export tab, import wordpress-redirection.csv (columns: source, target, regular expression 0 or 1, code). Beyond a few thousand rows, prefer server rules: the plugin can export its list in Apache and Nginx formats.
Shopify
Versions Shopify, all plans, November 2026.
In Content > Menus > URL redirects, choose Import and start from the CSV template Shopify provides. A redirect only applies if the old URL no longer matches any existing page, and some paths (/products, /collections, /collections/all, collection tag URLs) cannot be redirected.
Netlify
Versions Netlify, all plans, November 2026.
Add the contents of netlify-redirects.txt to the _redirects file in the publish directory, exact rules before pattern rules.
Vercel
Versions Vercel, all plans, November 2026.
Merge the redirects array from vercel-redirects.json into vercel.json. For very large volumes, Vercel offers bulk redirects from a file: check the documentation for your plan.
Laravel
Versions Laravel 12 and 13.
For thousands of rows, import the map into a redirects table (columns old_path, new_path, status) and look it up in a middleware placed before routing, with a cache, rather than declaring one route per row.
Common mistakes
- Starting from the crawl alone: orphan pages, PDFs and URLs that now only exist in external links fall through the cracks.
- Forgetting images and PDFs: they have their own backlinks and their own traffic, particularly in image search.
- Ignoring existing redirects: the redesign turns every old redirect into a chain.
- Redirecting everything to the home page: Google may treat these redirects as soft 404s. See avoid redirecting all deleted pages to the home page (opens in a new tab).
- Mixing URL forms (trailing slash, uppercase, domain) across tabs: the formulas no longer find the matches.
- Writing redirects directly on the server without a reference table: there is then no way to know what was decided, or to test it.
- Placing a pattern rule before exact rules: it captures URLs that had a dedicated target.
Frequently asked questions
How do I find all of a site's old URLs before a redesign?
Cross-reference several sources, because none is complete on its own: the site crawl, the sitemaps, the Pages tab of the Performance report and the Links report in Search Console, the landing pages in analytics, the backlink export, twelve months of server logs, the list of content in the CMS and Wayback Machine captures. Merge them in a spreadsheet after normalizing the URLs, then remove the duplicates.
Should images and PDFs be redirected during a migration?
Yes, when their address changes. Google asks you to include in the redirect map the files embedded in pages, such as images and videos, as well as CSS and JavaScript. Images and PDFs often have their own external links and their own traffic, particularly in image search. The site crawl and the server logs let you list them.
How many redirects can a site have without problems?
Google sets no limit on the number of redirects a site can have. The constraints come from the tool: some CDNs and CMSs cap the number of rows depending on the plan, and thousands of rules written one by one in a .htaccess file slow the server down. For a large map, use a lookup table (RewriteMap for Apache, map for Nginx) or the CDN's bulk redirects.
What format should the redirect map take?
A shared spreadsheet, one row per old URL, with at least the old URL, the decision (keep, 301, 410), the new URL, the reason and the test result. This file is the reference: from it, you then generate the format the server, CDN or CMS expects, for example a map file for Nginx or a CSV for Cloudflare, Shopify or the WordPress Redirection plugin.
Resources
- Google Search Central: Site moves with URL changesdevelopers.google.com
- Google Search Central: Redirects and Google Searchdevelopers.google.com
- Search Console Help: Links reportsupport.google.com
- Internet Archive: Wayback Machine CDX APIgithub.com
- Cloudflare: Bulk Redirects CSV file formatdevelopers.cloudflare.com
- Redirection: Import and export redirectsredirection.me
- Apache: RewriteMap and Nginx: map modulehttpd.apache.org
Updated on
Topic checklist (PDF)