Guides ยท Shopify redirects
Find redirect loops and chains in a Shopify CSV before you import it
A redirect file can hold loops and chains that nobody notices until after the import. You find out later, from a customer or from Search Console.
What a loop is
A loop is a set of redirects that leads back to where it started.
Redirect from,Redirect to /sale,/summer-sale /summer-sale,/sale
A visitor who opens /sale is sent to /summer-sale, then back to /sale, and so on. The browser stops after a number of hops and shows a "too many redirects" error. Nobody reaches a page.
Loops are rarely two rows next to each other. They usually come from two people editing the same file, or from merging an old redirect list with a new one. A loop can run through three, four or more rows spread across the file. The shortest loop is a single row that redirects an address to itself.
What a chain is
A chain is a redirect whose target is itself redirected.
Redirect from,Redirect to /v1/blue-mug,/legacy-blue-mug /legacy-blue-mug,/old-shop/blue-mug /old-shop/blue-mug,/products/blue-mug
The visitor does arrive, but only after three hops. Each hop is another request before the page starts loading, and search engines have more steps to follow before they reach the final address. Chains build up when a site has been moved more than once and each move added redirects on top of the last set.
The fix is to point every row straight at the final page:
Redirect from,Redirect to /v1/blue-mug,/products/blue-mug /legacy-blue-mug,/products/blue-mug /old-shop/blue-mug,/products/blue-mug
Finding them by hand
In a spreadsheet, add a column that checks whether each "Redirect to" value also appears in the "Redirect from" column. A COUNTIF over the source column does it. Every row where the count is above zero is the start of a chain or part of a loop.
That tells you where to look. It does not tell you where the chain ends, or whether it ever ends. For that you follow each one: look up the target, then that row's target, until you reach an address that is not redirected or one you have already seen. On a file with a few hundred rows this is tedious. On a few thousand it is where mistakes get in.
Two things trip up the manual check. Paths that differ only by a trailing slash or by capitals are the same address to a visitor, but not to COUNTIF. And full URLs mixed with bare paths will not match each other until you strip the domain.
What to do with what you find
| Problem | What to do |
|---|---|
| Chain | Point the row at the final target. Safe to do automatically. |
| Loop | Remove the rows in the loop, or correct the one that is wrong. This needs a decision: someone has to say where those addresses should go. |
| Row that leads into a loop | Leave it until the loop is resolved, then point it at the right page. |
| Self-redirect | Delete the row. |
Check your own file
Rowmill Redirect Check runs these checks on a Shopify redirect CSV or a Matrixify Redirects sheet. It is free, it runs in your browser, and your file is never uploaded.
Open the checker