跳到正文
Skillpedia
部署与云(DevOps)75k · #2989

redirect-chain

它能做什么

这个技能会沿着网站的重定向规则进行追踪,找出经过多次重定向的地址。它面向在网站迁移或更换域名后仍需要检查的网站所有者和开发者。

适用场景

  • ✓网站迁移或重新设计后,你请智能体检查是否存在重定向链的时候。
  • ✓页面加载缓慢,或搜索引擎似乎在到达最终页面前就停止了的时候。
  • ✓你升级内容系统,并想确保旧地址仍能直接指向正确页面的时候。

技能链接

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/redirect-chain/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/redirect-chain/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 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.

repo: thedaviddias/Front-End-Checklist

热度

GitHub 星标
75k
排名
#2989
许可证
MIT
更新时间
2026/10/31

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能