canonical-chain
它能做什么
这项技能检查页面的 canonical 地址是否会再跳转到其他地址。适合希望搜索引擎为每个页面收录正确版本的网站所有者。
适用场景
- ✓当 canonical 标签指向的地址会发生重定向时。
- ✓当网站更改了网址,但旧的 canonical 标签没有更新时。
- ✓当搜索引擎收录了页面的错误版本时。
技能链接
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/canonical-chain/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请检查我博客页面上的 canonical 链接,确保它们指向的地址可以直接加载、无需重定向。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会检查每个页面的 canonical 地址是否存在重定向,并把 canonical 标签更新为指向最终返回正常页面的地址。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Avoid redirect chains on canonical URLs
Canonical chains confuse search engines and can result in the wrong version of a page being indexed, while also adding unnecessary latency for crawlers.
Quick Reference
- Ensure that the URL in your
rel="canonical"tag returns a 200 OK status - Never point a canonical tag to a URL that then redirects to another location
- Verify that the canonical URL is the final, intended version of the content
Check
Verify that the canonical URL of the page does not result in any redirects.
Fix
Update the <link rel="canonical"> tag to point directly to the final, non-redirecting URL.
Explain
Explain why pointing a canonical tag to a redirecting URL weakens the canonical-url signal and impacts SEO.
Code Review
Review metadata generation, rendered HTML, structured data, and response headers related to Avoid redirect chains on canonical URLs. Flag exact routes or templates where search-facing output violates the rule, and describe how to verify the final page output.
For full implementation details, code examples, and framework-specific guidance,
see references/rule.md.
Rule page: https://frontendchecklist.io/rules/seo/canonical-chain
常见问题
canonical 中的重定向链为什么重要?
这项技能说明,它们会削弱 canonical 信号,并可能导致收录错误的版本。
canonical 网址应该返回什么状态?
这项技能说明,它应返回 200 OK 响应。
重定向会拖慢爬虫吗?
这项技能说明,重定向链会给爬虫增加不必要的延迟。
详情
作者的原始描述
Use when auditing metadata, crawlability, structured data, or indexability related to Avoid redirect chains on canonical URLs. Verify the rendered HTML and HTTP response rather than relying only on source files.
热度
- GitHub 星标
- 75k
- 排名
- #2765
- 许可证
- MIT
- 更新时间
- 2026/10/31
评论
- …
同一仓库的更多技能
frontendchecklist
75k使用命令行工具,依据 380 多条关于无障碍、速度、SEO 和安全的规则,检查前端代码和线上页面。
frontend-checklist-global
75k依据全部 386 条 Front-End Checklist 规则审查前端项目,并为发现的每个问题给出具体修复方法。
404-page
75k检查你的页面缺失提示是否提供有用的链接,并返回真正的 404 状态,帮助迷路的访客找到方向。
about-page
75k审查你的网站是否有清晰的关于页面,说明由谁运营,以建立访客和搜索引擎的信任。