跳到正文
Skillpedia
SEO75k · #2990

redirect-chains

它能做什么

这个技能检查你网站页面之间的链接,并更新所有指向会发生重定向的地址的链接。它面向更改过网址、希望内部链接保持干净的网站所有者。

适用场景

  • ✓你请智能体找出指向重定向页面的内部链接的时候。
  • ✓你完成了网址迁移,并希望把自己网站的链接更新为新地址的时候。
  • ✓菜单或文章中的链接在经过重定向后才加载,而你希望它们直接加载的时候。

技能链接

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

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

使用方法

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

可直接粘贴的消息

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

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

repo: thedaviddias/Front-End-Checklist

热度

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

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能