Skip to main content

What are redirect rules?

Redirect rules are pattern-based redirects that match groups of 404 URLs using wildcard variables. When a visitor accesses a URL matching your pattern, the rule automatically redirects them to your specified destination.
Redirect rules only work for broken links that lead to a 404 error page when visited. Active pages can’t be redirected.
Example use case:
  • You have 50 products with URLs like /products-old/shirt, /products-old/pants, /products-old/jacket
  • Instead of creating 50 individual 301 redirects
  • Create one redirect rule: /products-old/*/products/*
  • This handles all 50 products with a single rule
Redirect rules count toward your tracked visits quota each time they’re activated. 301 redirects don’t count toward quotas and are unlimited on all plans.

Redirect rules vs. 301 redirects

Feature301 RedirectsRedirect Rules
Best forSpecific individual URLsMultiple similar URLs
SetupOne redirect per URLOne rule for many URLs
Quota usageUnlimited (doesn’t count)Counts toward monthly tracked visits
SEO strengthPermanent, strongest signalTemporary, flexible
When to use each:
  • Use 301 redirects for permanent, high-traffic URL changes you want search engines to remember forever
  • Use redirect rules for temporary redirects, testing, or managing many similar URLs efficiently

Types of redirect rules

Starting from a template

Pre-built patterns for common redirect scenarios. Just select a template and customise the destination to your needs. Available templates:
  • Products - Redirect any broken product page to your homepage (/)
  • Collections - Redirect any broken collections page to the all collections page (/collections)
  • Pages - Redirect any broken page to your homepage (/)
  • Blog - Redirect any broken blog to the blogs homepage (/blogs)
When to use: Quick setup for standard redirect patterns without writing custom rules.

Custom rules

Build your own pattern using wildcard tokens for complete control. When to use: Unique URL structures that don’t match pre-built templates.

How redirect rules work

Redirect rules run JavaScript in the visitor’s browser to send them to a new page. They don’t help with SEO because search engines can’t follow JavaScript redirects.
Want SEO benefits? Use 301 redirects instead, or convert rule matches to 301s with the Enterprise plan.

The two parts of a redirect rule

1. Redirect from (what URLs to redirect) The pattern you’re looking for, using wildcard tokens that match any text:
  • Use wilcard tokens: (you can use up to 5)
  • Each token matches any characters
  • You must use at least one token in your “Redirect from” URL
Example: /category/⑴ matches /category/shirts 2. Redirect to (where to send them) The destination URL. Include wildcard tokens to preserve parts of the original URL:
  • Static redirect: /collections/all (everyone goes to the same place)
  • Dynamic redirect: /collections/⑴ (preserves the matched text)
Example: Match /category/⑴ and redirect to /collections/⑴
  • Visitor goes to: /categories/shirt
  • Gets redirected to: /collections/shirt
  • The captures “shirt” and reuses it

Using multiple wildcard tokens

Match: /blog/⑴/posts/⑵
Redirect to: /news/⑴/⑵
Result: /blog/2024/posts/announcement/news/2024/announcement Each wildcard (, , , etc.) captures a different piece in order and you can reuse them in the destination.

Rule matching example

Redirect from: /categories/⑴ Matches these URLs:
  • /categories/summer
  • /categories/winter-sale
  • /categories/anything-here
Doesn’t match:
  • /collections/summer
  • /products/shirt

Rule matches (Enterprise feature)

show the actual URLs visitors accessed that triggered your redirect rules. What you can see:
  • Real URLs that matched your rule
  • Where visitors were redirected to
  • How many times each URL was visited
What you can do:
  • Review which “to” and “from” URL pairings are actually being visited
  • Convert high-traffic matches into permanent 301 redirects
  • Optimize your redirect strategy based on real data
This feature is only available on the Enterprise plan. See View and manage rule matches for details.

When to use redirect rules

You’re migrating to Shopify which changes your URL structures (e.g., /product/ to /products/) and need to redirect hundreds of URLs at once.Use redirect rules to handle all URLs with a few rules instead of creating individual redirects.
You’re closing a market and need to redirect all country-specific URLs to your primary store.Use redirect rules with market-specific patterns. See Use redirect rules for discontinued markets.
You’re managing thousands of URLs that follow a predictable pattern.Use redirect rules to handle them efficiently with a single rule instead of thousands of 301s.

Redirect rule best practices

Templates are pre-tested patterns that cover common scenarios. Use them first before building custom rules.
Always test your redirect rule with a few sample URLs to ensure it redirects correctly. See Test redirect rules.
Each time a rule is triggered, it counts toward your monthly tracked visits. Check your usage regularly if you have high-traffic redirect rules.
If certain URLs in your rule get consistent traffic, Enterprise users can convert them into individual 301 redirects for better SEO and unlimited visits.
Complex patterns with many wildcard tokens can be hard to maintain. If a rule becomes too complicated, consider breaking it into multiple simpler rules or using 301 redirects instead.

Next steps

Need help?

If your redirect rule isn’t working as expected, see our troubleshooting guide: