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 th
复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-redirect-chains-c11026a7dc28 ,按照其中的说明把「redirect-chains」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
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.
Crawl internal links across the site. For each 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.
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.
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.
For each internal 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/en/rules/seo/redirect-chains