Redirect Chain (redirect-chain)
Summary
Redirect chains, loops, length, and permanent vs temporary redirects.
Classification
- Category:
SEO - Plugin id:
redirect-chain - Version:
1.0.0 - Target types:
WEBSITE,WEBSHOP - Weight class:
LIGHT - Risk level: not set on plugin object
- Browser required: No (HTTP / Node / other — see source)
- Tier / group: Tier 1 — HTTP-only
Schedule
- scheduleHints:
{ defaultInterval: '0 */6 * * *', priority: 5 } - Prerequisites: None declared on this plugin.
Configurable inputs
Public keys are derived from inputSchema: z.object({ ... }) (underscore-prefixed keys are runtime-only and omitted here).
| Field | Notes |
|---|---|
timeout |
Default 10000 ms per hop (1000–30000). |
maxChainLength |
Default 2 — chains longer than this trigger a finding (severity escalates at >4 hops). |
checkCommonVariants |
Default true — also trace http↔https and www↔non-www variants. |
Runtime / injected config
- None documented beyond standard worker context (
target,config,logger,reportProgress). Underscore-prefixed keys are internal.
Checks that produce findings
These checks run inside this plugin during a single test run. They are not separate tests in the database — each becomes a Finding linked to the Run for redirect-chain.
When checkCommonVariants is enabled, http/www variants are checked in addition to the primary URL.
| Check | Typical severity | Why |
|---|---|---|
| Redirect loop | CRITICAL | Same URL appears twice in the chain — browsers and crawlers may never reach content. |
Long redirect chain (> maxChainLength, default 2) |
INFO if 3–4 hops; WARNING if >4 | Each hop adds latency and dilutes PageRank/link equity to the final URL. |
| Temporary redirect (302/307) per hop | INFO (one finding per hop) | Temporary codes do not consolidate SEO signals like 301/308 would for permanent moves. |
| Redirect trace error | WARNING | Fetch failed or exceeded 20 hops — partial chain in evidence. |
How each check works
- URL set — Primary target URL plus, when variants enabled: HTTP counterpart of HTTPS URL, and www vs bare hostname variant.
- Trace — GET each URL with
redirect: 'manual', followLocationmanually up to 20 hops, SSRF-check each hop. - Loop detection — Compare all URLs in chain + final URL; duplicate → CRITICAL finding.
- Length — If
chain.length > maxChainLength(default 2): INFO when length ≤4, WARNING when >4. - Temporary hops — Each 302 or 307 in the chain emits its own INFO finding (can duplicate across variant traces).
- Errors — Network/timeout/max-depth → WARNING with partial chain.
- Score — −40 for loop, −8 per hop (max −30), −3 per INFO finding.
Caveats and concerns
- GET not HEAD — Uses GET with manual redirect handling; some servers behave differently per method.
- Per-hop 302 noise — Legitimate temporary redirects (A/B, geo) still flag INFO on every run.
- Variant overlap — www and canonical URL may report duplicate temporary-redirect findings for the same hop.
- No 301 vs 308 distinction — Only 302/307 flagged as “temporary”; 301/308 are silent.
- Single path — Does not crawl sitemap URLs or internal links for redirect issues.
Source
packages/test-plugins/src/plugins/redirect-chain.ts