Quick answer. A redirect chain is two or more hops between the requested URL and the final page. Chains waste crawl time and can weaken ranking signals. Paste your Apache, Nginx or _redirects rules plus real test URLs into a tester, collapse every chain to a single 301, and check regex capture groups for loops before you ship.

Redirects are a normal part of a healthy site. Chains and loops are not. A visitor who requests http://www.example.com/old-page and only arrives at https://example.com/new-page after three hops has paid for three round trips, and so has the crawler. Ranking signals are meant to be passed to the final URL; every extra hop is another place for a rule to expire, a cache to disagree, or a regex to over-match. This guide shows how those chains form, how risky regular expressions create loops, and how to flatten the map with the Redirect Chain and Regex Tester.

Google’s documentation on redirects and Search is the policy backdrop: use a single, clear permanent redirect when a URL has moved, and send people to the most relevant remaining page. The tester on this site is the preview you run before the rule reaches production.

What counts as a chain, a loop, and a clean hop

A clean redirect is one hop: request A, receive a 301 (or 308) Location of B, and B returns 200. A chain is A → B → C, or longer. A loop is A → B → A, or a cycle of three or more, or a rule that keeps matching the destination and appending another path. Temporary redirects (302, 307) have their place for A/B tests and truly short-lived moves, but a migration that still uses 302s years later is asking search engines not to consolidate signals.

Chains usually appear when several well-meaning rules stack. One rule forces HTTPS. Another strips www. A third adds a trailing slash. A fourth maps a retired slug to an interim slug that already has its own rule. Each rule is defensible. Together they turn every old bookmark into a four-step walk.

Worked example: four rules that look harmless in isolation

Suppose your Apache virtual host has collected this over two years (simplified):

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^www\.example\.com [NC]
RewriteRule ^(.*)$ https://example.com/$1 [R=301,L]
RewriteRule ^blog/old-post/?$ /blog/interim-post/ [R=301,L]
RewriteRule ^blog/interim-post/?$ /blog/new-post/ [R=301,L]

Now paste those rules, set the format to Apache, and test these URLs in the Redirect Chain and Regex Tester:

  • http://www.example.com/blog/old-post
  • https://www.example.com/blog/old-post/
  • https://example.com/blog/interim-post

You should see a chain, not a single hop. A typical path is HTTP plus www to HTTPS plus www, then to the apex, then to the interim slug, then to the new slug. The tester will also offer suggested single-hop rules. The version you want in production is closer to this idea: one host-canonical rule that sends any non-canonical scheme or host straight to https://example.com/…, and one slug rule that sends both /blog/old-post and /blog/interim-post straight to /blog/new-post/. Two rules, one hop from any historical bookmark.

That flattening is the whole job. Do not keep the interim slug “for a while” unless something still needs it. If nothing needs it, it is only a delay.

Regex that works, and regex that bites

Regular expressions are how you migrate a thousand dated blog URLs without a thousand literal lines. They are also how you accidentally redirect a whole section of the site, including the destination. The tester’s regex panel lets you try a pattern, flags, a replacement, and a sample input before the rule is near a server.

Anchor your patterns. A pattern such as blog/(.*) without start and end anchors can match more than the path you had in mind, or match a destination that still contains the word blog and fire again. Prefer something like ^/blog/([0-9]{4})/(.+)$ when you mean “old dated blog URLs,” and write the replacement so the destination cannot satisfy the same pattern. Watch capture groups: if you use $1 or a backreference in the replacement, confirm with sample inputs that the group is what you think it is, including trailing slashes and file extensions.

Greedy matches are a classic foot-gun. A pattern that eats past the first slash can send /docs/api/v2 to the wrong place. Unescaped dots in .html can match any character plus html. Case-sensitivity differs between Apache, Nginx and some static _redirects formats, so test in the same rule format you will deploy. The tester does not fetch your live site; it only evaluates the rules you paste. If a host-level redirect or a CDN rule is missing from the paste, the preview cannot see it. Paste every layer you know about, then confirm the live URL after deploy.

Canonical tags are not a substitute for a redirect

When you change a slug, do both jobs. The old URL should 301 to the new URL in one hop. The new URL should carry a self-referencing canonical, with tracking parameters stripped. A canonical alone on a URL that still returns 200 at the old address leaves two live documents. A redirect to a URL whose canonical points somewhere else again splits the signal. Build the destination’s tags with the Canonical and Pagination Tag Builder, then test the old addresses in the redirect tester so the hop lands on that exact canonical URL, including the trailing-slash policy you actually use.

Pagination and faceted filters deserve the same discipline. Do not 301 every filtered URL to page 1 of the category if those filters are still useful and indexable. Do not chain page 4 to page 3 to page 2 to page 1. If a filtered or paginated URL is retired, send it to the closest remaining indexable URL in one hop, and let the canonical builder express the page that remains.

Google’s canonical URL guidance and the redirects document should be read as a pair. Redirects move the address. Canonicals confirm the official address when similar URLs still exist.

A migration playbook that stays at one hop

Inventory the URLs you are retiring, including HTTP, www, slash and legacy CMS variants, not only the pretty current ones. Decide the single destination for each. Write rules that send every variant to that destination directly. Run the full list through the Redirect Chain and Regex Tester and fix any chain, loop or suspicious capture before you open a pull request. Merge the rules carefully with the host’s existing file — do not paste over a host rule that already forces HTTPS unless you are replacing it on purpose. Deploy, purge the cache, and request a sample of old URLs with a tool that shows the hop count. Update the sitemap so it lists only final 200 URLs, and update internal links so visitors do not have to use the redirects at all.

Internal links are the quiet half of this work. A redirect map is a safety net for bookmarks and inbound links. If your own navigation, blog posts and sitemaps still point at interim slugs, you are paying the hop on purpose. After the rules are clean, fix the links you control. The next guide in this series covers silo structure if you want to turn that cleanup into a clearer site architecture.

Redirects should be boring. One hop, a relevant destination, a self-canonical on the far side, and a regex you have tested with real paths. That is enough. If a rule still looks clever after you have read it twice, add three more test URLs — a trailing-slash variant, a mixed-case host, and an already-canonical address — and confirm the tester shows a single hop, or no hop at all, before anyone else has to debug it in production.

Frequently asked questions

Two or more hops between the requested URL and the final document. HTTP to HTTPS to apex to a new slug is a chain, even if each rule is a 301. Collapse it so every historical variant points directly at the final URL.

The Redirect Chain and Regex Tester follows each test URL through the pasted rules and flags a loop when a URL repeats in the hop list or a rule keeps matching the destination. Fix the pattern or the replacement so the destination no longer satisfies the same rule.

No. Rules stay in your browser and are evaluated locally. It will not see CDN or host redirects you did not paste. After you deploy, still request a few live URLs and confirm the hop count on the real stack.

Use a permanent 301 or 308 when the move is intended to last. A 302 is for a temporary relocation. Search systems may not consolidate signals through a long-lived temporary redirect the way you expect.

Yes, on the destination. The redirect handles the old address. The new page should carry a self-referencing canonical with tracking parameters stripped so similar URLs that still return 200 do not compete with it.