A domain move needs 1:1 redirects first and no catch-all rule

Post from r/TechSEO: Website migrations: How to test redirects
Post: r/TechSEO, u/rebelytics

Summary

Redirect chains in a domain move often come from rules already on the old site: legacy redirects that point at URLs now moving, and global rules that fire before the page-level map. A rule that swaps the old domain for the new one also carries the old site's dead URLs across.

Repoint legacy redirects at their final targets, run page-by-page rules before global ones, and skip the domain-swap fallback. When rules include host names, test them on staging with a host override before launch.

A Reddit thread on r/TechSEO sets out how to test redirects on staging before a migration. The advice comes from a project that merged three content platforms into an existing global corporate website. The poster, u/rebelytics, describes it as a 15-month project with SEO involved from the beginning. Their rules for avoiding redirect chains are mostly about order. The 1:1 rules go first. Global rules such as http to https or non-www to www run after them. And no rule should simply swap the old domain for the new one, not even as a fallback.

Where the extra hops come from

One common source of chains in a domain move is redirects that were already on the old site before anyone wrote the migration map. In a made-up example, old.com/shoes already has a legacy 301 to old.com/footwear, and the new map sends old.com/footwear to new.com/footwear. If the legacy rule stays, a request for old.com/shoes goes to old.com/footwear and then on to new.com/footwear. That is two hops where one would do. If an http to https rule runs before everything else, http://old.com/shoes picks up a third.

The thread’s fix for the legacy case is direct. When an existing redirect’s target is on your list of URLs that need redirecting, replace the redirect so it points straight at the final target. One commenter replied that people always forget this step. The same logic covers variants. Every 1:1 rule should match the www and non-www, http and https, and trailing slash versions of the old URL, so each one lands on the target in a single hop. Targets should be absolute URLs, and each one should return a 200.

Why the catch-all goes

The thread’s argument against the domain-swap catch-all is not about hops. An old domain has usually built up many URLs that no longer exist and return a mix of 4xx and 5xx codes. A rule that rewrites old.com/anything to new.com/anything moves all of that to the new domain. The poster treats the switch as the moment to leave that debt behind. The thread does not say this, but a catch-all also hides gaps in the map. An unmapped URL becomes a 301 to a 404 on the new domain, which is easy to miss in a crawl report that counts redirects as handled.

Testing rules that include host names

Once redirect rules include host names, a staging crawl of old paths no longer tests them. In the three-domain merge, the old domains shared some paths, so the rules had to include host names. The team pointed the three old domains at the staging server’s IP with a host override, bypassing public DNS, and crawled the old URLs against staging.

The test setup was ready only a few days before launch. On the Friday before a Monday launch, the crawl showed about 2000 high-traffic URLs returning 410 instead of redirecting. A plan to 410 some old URLs had been garbled on its way through five parties, from the legacy platform’s SEO agency to the technical provider. The team put in another full day of work over the weekend, and the corrected mapping went live two hours after launch.

What to do

  1. Build a priority list before the full map. It should cover URLs with clicks and impressions in Search Console, organic landing pages, URLs that rank, and URLs with backlinks from Search Console and outside link databases.
  2. Rewrite every legacy redirect whose target is moving so it points at the final URL on the new domain.
  3. Put 1:1 rules first, matching every protocol, host and trailing slash variant. Global rules come after them. Leave out the domain-swap catch-all.
  4. If rules include host names, crawl staging through a host override on the crawling machine:
# /etc/hosts on the crawling machine (IP is illustrative)
# Add the new domain too if its targets are not live yet
203.0.113.10  old-domain.com www.old-domain.com
  1. Crawl every mapped URL again after launch and confirm each one returns a 301 to the right target, and that the target returns a 200. Keep monitoring the old URLs, and agree on traffic loss limits before launch so the numbers have a meaning when they come in.

If developers push back on the number of rules, the thread suggests a compromise. After a few months, check the log files and remove rules for old URLs that nobody has requested and that have no backlinks.