In short
Testing redirects means requesting every old URL in the redirect map and checking three things: the response is a permanent redirect (301 or 308), it leads to the planned destination in a single hop, and that destination returns 200. The test is run on the staging site before the switchover, then on the live site on the day itself and in the weeks that follow. The deliverable is a results file in which every row carries a verdict.
Why it matters
During a redesign or a domain change, the old URLs are the ones that Google, Bing, generative engines, backlinks and visitors' bookmarks know. Only the redirect tells them where each piece of content now lives. Google recommends server-side permanent redirects for a site move, and advises testing URLs one by one with the Search Console URL Inspection tool and large lists with command-line tools or scripts.
A well-written redirect map can fail in execution for mundane reasons:
- a rule placed after a more general one never applies;
- the CDN (Content Delivery Network) or the application adds a hop (HTTP to HTTPS, adding
wwwor the trailing slash) and creates a chain; - the code is
302instead of301, because that is the tool's default; - URL parameters, capital letters or accented characters do not match the pattern;
- the destination itself returns a
404error or redirects again.
None of this shows up when browsing the new site: you have to request the old addresses.
What it improves
- Carrying rankings over Each old URL passes its signals on to its equivalent; this is the primary success factor of a migration.
- Crawling Fewer chains and errors, so fewer wasted requests for Googlebot and Bingbot. Google follows at most ten consecutive redirects.
- Backlinks and AI citations External links and the sources cited by AI assistants still lead to a useful page, not to an error.
- Visitor experience Bookmarks and links in emails and on social networks keep working.
- Project management The results file provides a quantified, dated list of fixes instead of impressions.
How to check
For a single URL, follow the complete chain:
curl -sIL https://example.com/ancienne-page | grep -i -E "^(HTTP|location)"
Correct result:
HTTP/2 301
location: https://example.com/nouvelle-page
HTTP/2 200
After launch, the Search Console URL Inspection tool, applied to an old URL with “Test live URL”, shows that the page redirects. In the Page indexing report, the reasons “Page with redirect” (normal for old URLs) and “Redirect error” (to fix) give the overall picture.
A test passes when 100% of priority URLs and at least 98% of the whole map get the OK verdict, and the remaining gaps are explained. These thresholds are an industry convention, not a search engine rule.
How to implement
Before you start
You need the comprehensive redirect map (opens in a new tab), as a two-column CSV: old URL, expected destination. For a removed page with no equivalent, the expected destination is 410 or 404.
Test schedule:
| When | Target | Goal |
|---|---|---|
| D−10 to D−2 | Staging | Fix the rules before the switchover |
| Launch day, within the hour | Live site | Check that the production configuration is the right one |
| D+1, D+7, D+30 | Live site | Detect regressions (deployment, cache, overwritten rule) |
Step 1 — Build the test file
Test the whole map, but make sure it does include these often-forgotten categories:
| Category | Source | Example |
|---|---|---|
| Pages that generate traffic or revenue | Search Console and analytics export (opens in a new tab), revenue-generating pages (opens in a new tab) | /plomberie/depannage-fuite |
| URLs that receive backlinks | backlink export (opens in a new tab) | /guide-2023.pdf |
| URLs cited by AI assistants | pages cited by AI systems (opens in a new tab) | /tarifs |
| Protocol and host variants | Generated | http://example.com/tarifs, https://www.example.com/tarifs |
| Trailing slash and capital letters | Generated | /Tarifs/ |
| URLs with parameters | Logs, analytics | /produits?categorie=the-vert&page=2 |
| Files | Pre-redesign crawl | indexed images, PDFs |
Save everything in plan.csv, with no header row:
https://example.com/plomberie/depannage-fuite,https://example.com/depannage/fuite-eau/
https://example.com/tarifs,https://example.com/tarifs/
http://example.com/tarifs,https://example.com/tarifs/
https://example.com/promo-noel-2022,410
URLs must be written exactly as the server will return them: https://example.com/tarifs/ and https://example.com/tarifs are two different URLs for the test.
Step 2 — Test without waiting for the DNS switch
If the staging site has its own hostname, replace the domain in a copy of the test file. If the redirects only work under the real domain name, query the new server under that name before changing the DNS, using curl's --resolve option (the RESOLVE variable in the script below) or a line in your computer's hosts file.
If the staging site is password-protected, as it should be (see protect and audit the staging site (opens in a new tab)), pass the credentials to the script with the AUTH variable.
Step 3 — Run the curl script
This free, dependency-free script works on macOS, Linux and Windows (WSL or Git Bash). It requests each URL twice: once without following the redirect, to read the code and target of the first hop, and once following it to the end.
#!/usr/bin/env bash
# Usage: ./tester-redirections.sh plan.csv > resultats.csv
# plan.csv: old_url,expected (destination URL, or 404 / 410), no header row
set -u
ua="Mozilla/5.0 (compatible; test-redirections)"
options=(-s -o /dev/null -A "$ua" --max-time 30)
if [ -n "${AUTH:-}" ]; then
options+=(-u "$AUTH")
fi
if [ -n "${RESOLVE:-}" ]; then
options+=(--resolve "$RESOLVE")
fi
echo "ancienne_url,attendu,code_1er_saut,cible_1er_saut,sauts,url_finale,code_final,verdict"
while IFS=, read -r ancienne attendu; do
ancienne="${ancienne%$'\r'}"
attendu="${attendu%$'\r'}"
if [ -z "$ancienne" ]; then
continue
fi
premier=$(curl "${options[@]}" -w '%{http_code} %{redirect_url}' "$ancienne")
code1="${premier%% *}"
cible1="${premier#* }"
final=$(curl "${options[@]}" -L --max-redirs 10 -w '%{num_redirects} %{http_code} %{url_effective}' "$ancienne")
read -r sauts code_final url_finale <<< "$final"
verdict="OK"
if [ "$attendu" = "404" ] || [ "$attendu" = "410" ]; then
if [ "$code1" != "$attendu" ]; then
verdict="CODE_INATTENDU"
fi
elif [ "$code1" != "301" ] && [ "$code1" != "308" ]; then
verdict="PAS_DE_REDIRECTION_PERMANENTE"
elif [ "$url_finale" != "$attendu" ]; then
verdict="MAUVAISE_DESTINATION"
elif [ "$code_final" != "200" ]; then
verdict="DESTINATION_EN_ERREUR"
elif [ "$sauts" -gt 1 ]; then
verdict="CHAINE"
fi
echo "$ancienne,$attendu,$code1,$cible1,$sauts,$url_finale,$code_final,$verdict"
done < "$1"
Examples of how to run it:
chmod +x tester-redirections.sh
# Live site
./tester-redirections.sh plan.csv > resultats.csv
# Password-protected staging site
AUTH="recette:motdepasse" ./tester-redirections.sh plan-preprod.csv > resultats-preprod.csv
# New server queried under the real domain, before the DNS switch
RESOLVE="example.com:443:203.0.113.10" ./tester-redirections.sh plan.csv > resultats-avant-dns.csv
# Keep only the anomalies
grep -v ",OK$" resultats.csv
The script sends requests one after the other: a few thousand URLs take from a few minutes to an hour. On a fragile server, do not parallelize it.
Step 4 — Test with Screaming Frog
Screaming Frog (free up to 500 URLs) does the same job with an interface:
Configuration > Spider > Advanced: tickAlways Follow Redirects, so that the tool follows each chain to its end even in list mode.- For a protected staging site:
Configuration > Authentication, standards-based authentication tab, then enter the credentials when prompted. Mode > List, thenUpload > Pasteand paste the column of old URLs.- Once the crawl has finished, open
Reports > Redirects > All Redirects: each row gives the starting URL, the number of hops, the final URL and its status code. - Export, then compare the final URL with the expected destination in a spreadsheet, using a lookup on the old URL.
In Google Sheets or Excel, with the export in an Export tab and the map in a Plan tab (column A old URL, column B destination), the check formula for column C of the map is:
=IF(XLOOKUP(A2,Export!A:A,Export!F:F,"missing")=B2,"OK","TO CHECK")
Adjust the column letter F to that of the final URL in your export. In a French-language version of Excel, the functions are called SI and RECHERCHEX.
Step 5 — Read the verdicts and fix
| Verdict | Usual cause | Fix |
|---|---|---|
PAS_DE_REDIRECTION_PERMANENTE (no permanent redirect) with 302 or 307 |
Default value of the plugin or rule | Switch the rule to 301 or 308: see use 301/308 for permanent moves (opens in a new tab) |
PAS_DE_REDIRECTION_PERMANENTE with 404 |
Missing rule, pattern that does not match, rule hidden by another | Add or reorder the rule |
PAS_DE_REDIRECTION_PERMANENTE with 200 |
The old URL still exists on the new site (test page, duplicate) | Remove the duplicate or redirect |
MAUVAISE_DESTINATION (wrong destination) |
Typo, overly broad generic rule, redirect to the homepage | Fix the target: see avoid redirecting all removed pages to the homepage (opens in a new tab) |
DESTINATION_EN_ERREUR (destination in error) |
New page not published, slug changed since the map was made | Publish the page or update the map |
CHAINE (chain) |
Separate HTTPS or www hop, trailing slash added by the application |
Rewrite the rule to target the final URL: see fix redirect chains (opens in a new tab) |
CODE_INATTENDU (unexpected code) on a URL expected to return 410 |
Removed page that redirects anyway | See return 404/410 for removed content (opens in a new tab) |
Code 000 |
Timeout, invalid certificate, blocked by the firewall | Test the URL by hand, check the certificate and the security rules |
Fix in batches, then run the script again on the complete file, not just on the fixed rows: a new rule can break another one.
Cloudflare
Versions Cloudflare dashboard, all plans, November 2026.
Redirect Rules, Bulk Redirects and Workers only apply to traffic that goes through Cloudflare. A test with --resolve pointing to the origin server's IP address bypasses them: it only shows the server's redirects. To test Cloudflare rules before the switchover, test under the real domain name once the DNS record is proxied (orange cloud), or on a proxied test subdomain carrying the same rules. Bulk redirect lists are managed in Bulk Redirects; after a change, wait for it to propagate, then run the script again.
WordPress
Versions WordPress 6.4 and later.
The Redirection plugin lets you set the code for each rule: check that it is set to 301. Its 404 error log (Tools > Redirection, 404s tab) is a complementary source after launch: any URL that appears there often is an old address missing from the map. If a page cache is active (plugin or host), clear it before each round of tests: a page cached before the rule was created can hide the redirect.
Shopify
Versions Shopify admin, all plans, November 2026.
A Shopify URL redirect only applies if the old address no longer matches any existing page in the store. A PAS_DE_REDIRECTION_PERMANENTE verdict with a 200 code therefore often means that a product, collection or page still uses the old URL handle. Shopify also adds its own prefixes (/products/, /collections/, /pages/): write the expected destination with these prefixes in the test file.
Common mistakes
- Testing a sample of ten URLs: errors hide in rare patterns (parameters, capital letters, old sections). Test the whole map every time.
- Following redirects without reading the first hop:
curl -Lon its own shows200even if the first hop is a302or the chain has three steps. - Testing with a browser: it caches
301s and hides fixes. Use curl or a cleared private window. - Forgetting the
http://andwwwvariants: old backlinks often point to them and produce chains. - Accepting a redirect to the homepage as a success: Google may treat it as a soft 404; either the page has no equivalent or the map is incomplete.
- Testing staging with its own configuration: if production goes through a different CDN, server or set of rules, run the full test again on the live site on launch day.
- Stopping on launch day: a plugin update, a deployment or a purge of rules can break everything a week later. Schedule D+1, D+7 and D+30.
Frequently asked questions
How many URLs should you test after a redesign?
Test every URL in the redirect map, not a sample. Errors concentrate on rare cases: old sections, URLs with parameters, capital letters, http or non-www variants. A curl script tests several thousand addresses in under an hour, and Screaming Frog does it in list mode. Aim for 100% success on priority pages and explain every remaining gap.
Should a migration use a 301 or a 308 redirect?
Both are suitable for a permanent move: Google treats them the same way and passes signals on to the new URL. A 308 also guarantees that the request method is not changed, which matters for forms or APIs. Avoid 302 and 307, on the other hand: they are temporary, and plugins and CDNs often apply them by default.
Can you test redirects before changing the DNS?
Yes. With curl, the --resolve option sends the request to the new server while using the real domain name, without touching the public DNS. A line in your computer's hosts file has the same effect for the browser and crawlers. Be careful: the rules of a CDN such as Cloudflare do not apply in this case, because the request reaches the origin server directly.
Why does a redirect work in the browser but not for Google?
The browser caches 301 redirects: it can display the right destination even though the server returns something else. A rule can also depend on a cookie, on a language, or on a JavaScript redirect that Googlebot does not follow in the same way. Always test with curl, without cookies, then confirm with the Search Console URL Inspection tool.
Resources
- Google Search Central: Site moves with URL changesdevelopers.google.com
- Google Search Central: Redirects and Google Searchdevelopers.google.com
- MDN: Redirections in HTTPdeveloper.mozilla.org
- curl: --resolve option documentationcurl.se
- Cloudflare: Bulk Redirectsdevelopers.cloudflare.com
- Shopify: URL redirectshelp.shopify.com
Updated on
Topic checklist (PDF)