Technical
TechnicalMedium

No Client-Side Redirects

Checks that redirects happen server-side, not via JavaScript.

What this check measures

We fetch each URL and check for `window.location = ...` or `location.replace(...)` patterns in the initial response. Client-side redirects work for users but cost SEO.

Why it matters

JavaScript redirects pass some ranking equity but slower than HTTP 301. AI crawlers without JS cannot follow them at all — page becomes orphaned for AI search.

search

How our audit detects it

Parse JS for meta refresh or window.location assignments in initial page load. Flag if redirect should be server-side.

Typical findings

  • error_outlineuseEffect(() => window.location = "/new-url").
  • error_outline<meta http-equiv="refresh" content="0; URL=/new">
  • error_outlineAuth guard redirects via router.push instead of middleware.

How to fix

Replace client redirects with server-side 301/302. In Next.js use `redirect()` from next/navigation or middleware. Meta refresh = anti-pattern.

Frequently asked questions

When are JS redirects OK?expand_more
Inside the authenticated app, for navigation after an action. Never for SEO-relevant URL changes.

Want this checked on your site?

Pantra runs the full audit (SEO, Security, GEO, Performance, Schema, Technical, Images) in 10 seconds and generates stack-specific fix prompts.

Scan my site

Related checks