redirect-chains
它能做什么
这个技能检查你网站页面之间的链接,并更新所有指向会发生重定向的地址的链接。它面向更改过网址、希望内部链接保持干净的网站所有者。
适用场景
- ✓你请智能体找出指向重定向页面的内部链接的时候。
- ✓你完成了网址迁移,并希望把自己网站的链接更新为新地址的时候。
- ✓菜单或文章中的链接在经过重定向后才加载,而你希望它们直接加载的时候。
技能链接
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/redirect-chains/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我更改网址后,网站上的一些链接仍然会经过重定向。请帮我把它们更新为指向最终页面吗?”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会检查网站上的每个内部链接,并跟随它查看是否发生重定向。然后它会把链接地址更新为最终页面;对于仍在使用旧地址的外部链接,则保留重定向。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Link directly to final destination URLs
Internal links that point to redirect URLs add latency, waste crawl budget, and pass less PageRank to the destination than a direct link would—reducing the ranking potential of linked pages.
Quick Reference
- Internal links should point directly to the final destination URL, not to a URL that redirects
- Each redirect in a chain dilutes the PageRank passed through it
- Update internal links after URL migrations to point to the new URLs
- Use 301 redirects for permanent moves, but then update source links
Check
Crawl internal links across the site. For each <a href='...'> tag, follow the URL and check the HTTP response code. Flag any internal link that resolves to a 301 or 302 redirect rather than a direct 200 response. Report the source page, linked URL, and the final destination URL after following the redirect.
Fix
For each internal link pointing to a redirect URL: update the href attribute to point directly to the final destination URL (the 200-status URL after following all redirects). Keep the redirect in place for external links, but update all internal links to point directly to the canonical-url destination.
Explain
When Googlebot follows a link to a URL that then redirects to another URL, PageRank is partially lost at each hop. Google has stated that redirects dilute PageRank. Additionally, linking to redirect URLs wastes crawl budget since Googlebot must make multiple requests to reach the final content. Updating internal links to point directly to destination URLs passes full PageRank and improves crawl efficiency.
Code Review
For each internal <a href='...'> link, follow the URL and check the HTTP response code. If the response is 301 or 302, record the Location header and continue following. Report all internal links that resolve via one or more redirects before reaching a 200 response. Include: source page, link href, each redirect URL in the chain, and final destination URL.
For full implementation details, code examples, and framework-specific guidance,
see references/rule.md.
Rule page: https://frontendchecklist.io/rules/seo/redirect-chains
常见问题
我应该删除重定向吗?
不应该。这个技能说,应为外部链接保留重定向,并更新你自己网站上的内部链接。
为什么要更新内部链接?
指向重定向地址的链接会增加延迟,而且比直接链接传递的排名价值更少。
智能体会给我什么结果?
它会报告来源页面、链接地址,以及重定向后的最终目标。
详情
作者的原始描述
Use when auditing internal link structure after a URL migration, domain change, or site rebuild. Applies to any site that has had redirects in place for more than a month.
热度
- GitHub 星标
- 75k
- 排名
- #2990
- 许可证
- MIT
- 更新时间
- 2026/10/31
评论
- …
同一仓库的更多技能
frontendchecklist
75k使用命令行工具,依据 380 多条关于无障碍、速度、SEO 和安全的规则,检查前端代码和线上页面。
frontend-checklist-global
75k依据全部 386 条 Front-End Checklist 规则审查前端项目,并为发现的每个问题给出具体修复方法。
404-page
75k检查你的页面缺失提示是否提供有用的链接,并返回真正的 404 状态,帮助迷路的访客找到方向。
about-page
75k审查你的网站是否有清晰的关于页面,说明由谁运营,以建立访客和搜索引擎的信任。