squirrelscan
GitHub

Links pointing at redirecting URLs: the hop on every click

An internal link to a URL that redirects costs a round trip every time anyone follows it. squirrel finds redirecting pages and who links to them.

What linking to a redirect costs

A redirect is fine as a safety net for old URLs arriving from elsewhere. It is waste when your own pages link to the redirecting URL instead of the destination, because every click and every crawl pays a round trip that a corrected link would remove.

The pattern accumulates after any restructure. The redirect is set up, the content is moved, and the links in body copy and navigation still point at the old address. Nothing appears broken, so nothing prompts a fix.

What squirrel checks

The rule is site-wide and works in two passes. First it finds crawled pages that redirected: either the request target changed, comparing path, trailing slash and query, or a redirect was actually observed in the recorded chain. Then it walks every internal link on every page and matches it against those redirecting URLs.

  • Skipped when no pages are available. Message: No pages available for redirect analysis.
  • redirect-pages warns for the redirecting URLs themselves. Message: 5 page(s) redirect to another URL. A multi-hop chain is labelled with full URLs and status codes, https://example.com/old (301) → https://example.com/new (200). With no multi-hop chain the label falls back to original → final with no status codes.
  • links-to-redirect warns for the link targets. Message: 3 link target(s) point to redirecting URLs, each item carrying the chain and every page that links to it.
  • redirect-chains passes when neither fired. Message: No redirects detected.

Link matching is slash-sensitive. A page that links /about/ is not blamed for /about’s redirect, because those are different hrefs and only one of them is the mistake.

How to fix it

Rewrite the links to point at the final URL. The report lists which pages carry each one, so a link repeated in a template is a single change.

Leave the redirect in place. It is still doing its job for links you do not control.

Rule IDlinks/redirect-chains
CategoryLinks
ScopeSite-wide
Severitywarning
Weight4/10

Enable / disable

Disable this rule

[rules]
disable = ["links/redirect-chains"]
[rules]
disable = ["links/*"]

Enable only this rule

[rules]
enable = ["links/redirect-chains"]

enable replaces the default ["*"], so this is the only rule selected. Leave disable out: a rule that matches any disable pattern is skipped even when enable names it. Only an enabled setting under a rule’s own [rule_options] table overrides both lists.

Links findings ship in every audit next to the SEO, performance and agent experience rules. See Fix SEO issues with AI for how an agent works through a report.

References

Check your site

Run squirrel audit https://example.com and open the Links section of the report. Each redirecting target is listed with its chain and the pages that link to it. Signed-out local audits need no account and cost nothing. Signed-in audits spend credits.

Type to search…

↑↓ navigate↵ openesc close