Redirect chain cleanup
Each hop in a redirect chain costs crawl time and risks the chain breaking somewhere in the middle. Chains accumulate quietly across years of site changes. This skill flattens them without losing any rule.
Use after a migration, a domain change, or whenever a crawl reports redirects pointing at other redirects.
The skill file
What you need first
- A full crawl including redirect targets
- The current redirect rules from the server or CDN
Method
- 01 Export every URL returning 3xx along with its final destination and the number of hops.
- 02 Flag anything with two or more hops, and anything ending in a 4xx or 5xx - a chain to nowhere is worse than no redirect.
- 03 Rewrite each multi-hop rule to point directly at the final 200 destination.
- 04 Check for redirect loops, which serve nothing at all and are usually invisible until someone hits them.
- 05 Confirm redirect type is correct: 301 for permanent moves, 302 only where the original genuinely returns.
- 06 Re-crawl and verify every previously-chained URL now resolves in one hop.
What this produces
A flattened redirect map, plus a list of chains that ended in errors and now need a real destination.
Where this goes wrong
- Flattening a chain but leaving the intermediate rule in place, so it fires again later
- Using 302 for a permanent move, which withholds consolidation
- Removing an old rule because it looks unused, when it still receives links
Use this skill in your own AI
The download is a plain markdown file with the name and trigger in its frontmatter. Where an assistant supports skills it can load itself, that frontmatter is what it reads to decide this one applies.
Questions about this skill
When is flattening chains worth the work rather than adding one more rule?
After a migration or a domain change, or whenever a crawl reports redirects pointing at other redirects. Adding one more rule on top is how chains form: each change is individually reasonable and the stack is never read end to end. Browsers follow chains without complaint, so nothing surfaces until a crawler counts the hops for you.
What do I need in hand before starting?
A full crawl exporting every 3xx with its final destination and hop count, plus the current rule set from the server or the CDN. Without the rules you can see the chains but cannot edit them safely, and you will flatten a path while leaving the intermediate rule in place, where it fires again the next time someone hits the original URL.
What do I end up with, and which part gets used?
A flattened redirect map, plus a list of chains ending in a 4xx, a 5xx or a loop. That second list is what gets used first: a chain to nowhere is worse than no redirect at all, because the equity stops dead and the visitor reaches an error after two hops. The flattening itself is mechanical once every destination is confirmed to return 200.
What is the mistake that ruins this, and what does it cost?
Deleting a rule because nothing in the crawl uses it. Old URLs are by definition not linked from your own site, so the ones still receiving external links and traffic are exactly the ones an internal crawl cannot find. Check referring domains before removing anything. The other costly habit is leaving a 302 on a permanent move, which withholds consolidation for as long as it stands.
More in Technical SEO
Crawl budget audit
Use when a large site has pages that stay unindexed for weeks, or when log files show crawlers s...
Indexation gap analysis
Use when the number of pages you publish and the number Google indexes do not match, and you nee...
Core Web Vitals triage
Use when field data shows failing LCP, INP or CLS and you need to know which fix will actually m...
JavaScript rendering check
Use when a site renders content client-side and you need to confirm search engines actually see...