Most teams treat redirects as a launch-week chore: export a spreadsheet, hand it to a developer, spot-check five URLs, and hope. Then rankings dip for three months and nobody can say why. Redirects are code that decides where your link equity lands, so they deserve version control, tests, and a failing build when they break.
A Spreadsheet Is Not a Redirect Strategy
The failure pattern is predictable. A migration lands, the redirect map covers the pages someone remembered, and everything else returns a 404 or, worse, a soft 404 that redirects to the homepage. Google treats mass homepage redirects as soft 404s and drops the equity anyway. Meanwhile old redirects from the last two migrations are still live, so a legacy URL now bounces through three hops before it resolves.
None of this shows up in a design review. It shows up in Search Console six weeks later as a slow bleed. The fix is to stop treating the map as a document and start treating it as a data file with a schema, an owner, and a test suite that runs on every pull request.
Put the Map in the Repo and Write the Tests
Store redirects as a flat file, CSV or JSON, with source, destination, and status code. Keep it in the same repository as the site config so every change gets a diff and a reviewer. Then write four assertions that run in CI:
First, no chains. Resolve each destination against the map itself and fail if it appears as a source. Second, no loops. A simple graph walk catches A to B to A in milliseconds. Third, every destination returns 200. Request the target and fail on 3xx, 4xx, or 5xx. Fourth, coverage. Feed in your top landing pages from Search Console and your most linked URLs from your backlink export, and fail if any legacy URL lacks a mapping.
A 30-line Node or Python script handles the first two with no network access. The last two need a staging host and a crawl list, which you already have if you run a crawler such as Screaming Frog or a headless script. Run the cheap tests on every commit and the network tests on every merge to the release branch.
| Check | What it catches | When to run |
|---|---|---|
| Chain detection | Multi-hop redirects that dilute crawl budget | Every commit |
| Loop detection | Infinite redirects that take pages offline | Every commit |
| Destination status | Redirects pointing at 404s or 5xx | Pre-release against staging |
| Coverage vs top pages | Unmapped URLs with traffic or links | Pre-release against staging |
| Homepage dumping | Mass redirects to the root, treated as soft 404s | Every commit |
Match Intent, Not Just Structure
Automated tests prove the map is mechanically sound. They cannot prove it is right. A redirect from a retired pricing page to the new pricing page is correct. A redirect from a deleted comparison post to the blog index is a guess. For every legacy URL with meaningful traffic, the destination should answer the same query the old page did.
Use an LLM for the tedious part, with a human on the approval path. Embed the old page content and the candidate new pages, propose the nearest match, and flag anything below a similarity threshold for manual review. The model drafts the map, the tests validate it, and a person signs off on the top 200 URLs by traffic. That split keeps the work fast without letting a hallucinated mapping ship.
Also decide what should not redirect. Thin pages with no traffic and no links are better returned as a clean 410. Forcing everything to a loosely related page adds noise and teaches search engines that your redirects are unreliable.
Monitor After Launch Like You Would Any Release
The deploy is the start of verification, not the end. Pull server logs for the first two weeks and track the status codes served to Googlebot on legacy URLs. A healthy migration shows 301s trending down as crawlers update their index, with no growth in 404s. Set an alert on any legacy URL returning 404, and on any redirect response time above 200 milliseconds, since slow redirects at the edge hurt both crawling and users.
Keep the map in the repo permanently. Old URLs earn backlinks for years, and the day someone deletes the file to clean up is the day equity vanishes.
Redirect
- Store the map as a versioned file in the site repository
- Fail the build on chains, loops, and homepage dumping
- Verify every destination returns 200 on staging
- Map 100 percent of top organic landing pages and top linked URLs
- Review LLM-suggested matches for the top 200 URLs by traffic
- Return 410 for dead pages with no traffic or links
- Alert on legacy URL 404s in the first 14 days
- Never delete old redirects without checking backlink data first
Redirects look boring until they fail. Treat them as tested code and the next migration becomes a non-event instead of a quarter of recovery work.
Tags
LETSGROW Dev Team
Marketing Technology Experts
Ready to Apply This Insight?
Schedule a strategy call to map these ideas to your architecture, data, and operating model.
Schedule Strategy Call