# Test redirects

- Check 44.15 · Redesign and migration · Critical
- Source: https://checklist-seo-geo.com/en/redesign-migration/test-redirects
- Test the whole redirect map before and after the switchover: test list, free curl script, Screaming Frog, reading the verdicts and fixes.
- Updated on 2026-11-25
- Licence: CC BY 4.0. Credit “Checklist SEO & GEO” with a link to https://checklist-seo-geo.com/en/redesign-migration/test-redirects.
- Plugin checklist-seo-geo: 1.3.1 · https://github.com/maximegaul/checklist-seo-geo

## 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 `www` or the trailing slash) and creates a chain;
- the code is `302` instead of `301`, because that is the tool's default;
- URL parameters, capital letters or accented characters do not match the pattern;
- the destination itself returns a `404` error 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:

```bash
curl -sIL https://example.com/ancienne-page | grep -i -E "^(HTTP|location)"
```

Correct result:

```txt
HTTP/2 301
location: https://example.com/nouvelle-page
HTTP/2 200
```

After launch, the Search Console [URL Inspection tool](https://search.google.com/search-console?action=inspect), applied to an old URL with “Test live URL”, shows that the page redirects. In the [Page indexing report](https://search.google.com/search-console/index), 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](https://checklist-seo-geo.com/en/redesign-migration/create-comprehensive-redirect-map), 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](https://checklist-seo-geo.com/en/redesign-migration/export-search-console-analytics-data), [revenue-generating pages](https://checklist-seo-geo.com/en/redesign-migration/identify-revenue-generating-pages) | `/plomberie/depannage-fuite` |
| URLs that receive backlinks | [backlink export](https://checklist-seo-geo.com/en/redesign-migration/export-backlinks) | `/guide-2023.pdf` |
| URLs cited by AI assistants | [pages cited by AI systems](https://checklist-seo-geo.com/en/redesign-migration/identify-pages-cited-ai-systems) | `/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:

```txt
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](https://checklist-seo-geo.com/en/redesign-migration/protect-audit-staging-site)), 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.

```bash
#!/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:

```bash
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:

1. `Configuration > Spider > Advanced`: tick `Always Follow Redirects`, so that the tool follows each chain to its end even in list mode.
2. For a protected staging site: `Configuration > Authentication`, standards-based authentication tab, then enter the credentials when prompted.
3. `Mode > List`, then `Upload > Paste` and paste the column of old URLs.
4. 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.
5. 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:

```txt
=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](https://checklist-seo-geo.com/en/http-redirects/use-301-308-permanent-moves) |
| `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](https://checklist-seo-geo.com/en/http-redirects/avoid-redirecting-all-removed-pages-homepage) |
| `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](https://checklist-seo-geo.com/en/http-redirects/fix-redirect-chains) |
| `CODE_INATTENDU` (unexpected code) on a URL expected to return `410` | Removed page that redirects anyway | See [return 404/410 for removed content](https://checklist-seo-geo.com/en/http-redirects/return-404-410-removed-content-no-equivalent) |
| 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](https://dash.cloudflare.com/?to=/:account/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 -L` on its own shows `200` even if the first hop is a `302` or the chain has three steps.
- **Testing with a browser**: it caches `301`s and hides fixes. Use curl or a cleared private window.
- **Forgetting the `http://` and `www` variants**: 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 changes](https://developers.google.com/search/docs/crawling-indexing/site-move-with-url-changes?hl=en)
- [Google Search Central: Redirects and Google Search](https://developers.google.com/search/docs/crawling-indexing/301-redirects?hl=en)
- [MDN: Redirections in HTTP](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Redirections)
- [curl: --resolve option documentation](https://curl.se/docs/manpage.html#--resolve)
- [Cloudflare: Bulk Redirects](https://developers.cloudflare.com/rules/url-forwarding/bulk-redirects/)
- [Shopify: URL redirects](https://help.shopify.com/en/manual/online-store/menus-and-links/url-redirect)

Next steps: [check canonicals, hreflang, sitemaps and robots.txt](https://checklist-seo-geo.com/en/redesign-migration/check-canonicals-hreflang-sitemaps-robotstxt) and [crawl the site after launch](https://checklist-seo-geo.com/en/redesign-migration/crawl-site-after-launch).
