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.
- 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
| Feature | 301 Redirects | Redirect Rules |
|---|---|---|
| Best for | Specific individual URLs | Multiple similar URLs |
| Setup | One redirect per URL | One rule for many URLs |
| Quota usage | Unlimited (doesn’t count) | Counts toward monthly tracked visits |
| SEO strength | Permanent, strongest signal | Temporary, flexible |
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)
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.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
/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)
/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✓
/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
- 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
Shopify migrations
Shopify migrations
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.Discontinued Shopify markets
Discontinued Shopify markets
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.
High-volume URL changes
High-volume URL changes
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
Start with templates when possible
Start with templates when possible
Templates are pre-tested patterns that cover common scenarios. Use them first before building custom rules.
Test rules before going live
Test rules before going live
Always test your redirect rule with a few sample URLs to ensure it redirects correctly. See Test redirect rules.
Monitor your quota usage
Monitor your quota usage
Each time a rule is triggered, it counts toward your monthly tracked visits. Check your usage regularly if you have high-traffic redirect rules.
Convert high-traffic rules to 301s
Convert high-traffic rules to 301s
If certain URLs in your rule get consistent traffic, Enterprise users can convert them into individual 301 redirects for better SEO and unlimited visits.
Keep rules simple
Keep rules simple
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
Create a redirect rule
Set up your first redirect rule
Test redirect rules
Verify rules are working as expected
Edit or delete rules
Manage existing redirect rules
View rule matches (Enterprise)
See which 404 URLs triggered your rules
Related guides
- Create a redirect - Set up permanent 301 redirects
- Understanding usage quotas - Learn about tracked visits limits
- Convert matches into permanent redirects - Optimize your redirect strategy
Need help?
If your redirect rule isn’t working as expected, see our troubleshooting guide:- Redirect rule not working - Common issues and fixes