redirect-chain
它能做什么
这个技能会沿着网站的重定向规则进行追踪,找出经过多次重定向的地址。它面向在网站迁移或更换域名后仍需要检查的网站所有者和开发者。
适用场景
- ✓网站迁移或重新设计后,你请智能体检查是否存在重定向链的时候。
- ✓页面加载缓慢,或搜索引擎似乎在到达最终页面前就停止了的时候。
- ✓你升级内容系统,并想确保旧地址仍能直接指向正确页面的时候。
技能链接
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/redirect-chain/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我的网站迁移过好几次。请帮我检查是否有重定向链,并让每个旧地址直接指向最终页面吗?”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会沿每条重定向规则逐步追踪,并记录每一跳以及每一步的响应代码。然后它会更新第一个重定向,使其直接指向最终地址,并检查结果是否为一次重定向后直接进入可用页面。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Avoid multi-hop redirect chains
Redirect chains waste crawl budget, reduce PageRank flow to destination pages, and add latency that harms user experience—Googlebot may abandon long chains entirely, leaving destination pages undiscovered.
Quick Reference
- A redirect chain is A→B→C — Googlebot may stop following after 5 hops
- Each hop loses PageRank and adds page load latency
- Flatten chains by pointing A directly to C with a single 301
- Audit after every URL migration to catch newly created chains
Check
Follow all redirect rules configured on the site. Identify any URL where the redirect target itself also redirects (chain of 2+ hops). Report the full chain (URL A → URL B → URL C → final), the number of hops, and the HTTP response code at each step.
Fix
For each redirect chain, update the first redirect to point directly to the final destination URL. Example: if A→B→C, update A's redirect to point directly to C, eliminating the B hop. Verify the chain is gone by following the URL and confirming a single 301 or 302 followed by a 200.
Explain
A redirect chain occurs when page A redirects to page B, which also redirects to page C. Googlebot follows redirect chains up to a certain number of hops (reportedly 5), then stops—meaning the final destination may not be crawled. Each redirect also loses a portion of the PageRank that would have passed through a direct link.
Code Review
Test each redirect rule configured on the server. For each source URL, follow all redirect hops and record the full chain. Flag any chain with 2 or more hops (source → intermediate → final). Check for redirect loops (A→B→A). Verify that the final destination returns 200. Report: source URL, intermediate URLs, number of hops, final URL, and HTTP status at each step.
For full implementation details, code examples, and framework-specific guidance,
see references/rule.md.
Rule page: https://frontendchecklist.io/rules/seo/redirect-chain
常见问题
重定向链为什么是问题?
每多一跳都会增加延迟并损失一些排名权重,这个技能说 Googlebot 可能会在长链中停止跟随。
这个技能有特定的跳转次数限制吗?
这个技能说,据报道 Googlebot 大约在五跳后停止。
我应该何时检查重定向?
这个技能建议在每次网址迁移后都进行检查,以便及时发现新的重定向链。
详情
作者的原始描述
Use when auditing site redirects after URL migrations, domain changes, or CMS upgrades. Applies to any site that has had multiple rounds of structural changes over time.
热度
- GitHub 星标
- 75k
- 排名
- #2989
- 许可证
- MIT
- 更新时间
- 2026/10/31
评论
- …
同一仓库的更多技能
frontendchecklist
75k使用命令行工具,依据 380 多条关于无障碍、速度、SEO 和安全的规则,检查前端代码和线上页面。
frontend-checklist-global
75k依据全部 386 条 Front-End Checklist 规则审查前端项目,并为发现的每个问题给出具体修复方法。
404-page
75k检查你的页面缺失提示是否提供有用的链接,并返回真正的 404 状态,帮助迷路的访客找到方向。
about-page
75k审查你的网站是否有清晰的关于页面,说明由谁运营,以建立访客和搜索引擎的信任。