How to Use Wildcard Redirects
When a user tries to access a store URL that no longer exists, they typically run into a 404 error message.
Shopify does not support wildcard redirects as they must match the URL exactly.
Ablestar Link Manager allows you to use wildcard redirects (also known as pattern redirects) to configure and redirect all URLs that start with specified text to a new location.
Wildcard redirects with our app perform faster than other apps to ensure 404 page warnings are not visible while redirecting pages.
Standard Wildcards
Similar to exact URL redirects, wildcard redirects have two parts. Placeholder text is used and start with the dollar sign and then a number from (1-5). For example:
- Redirect from:
/store/$1
would match any URL that starts with/store/.../
- Redirect to: using
/$1/$2
to/new/$2
, the following redirects would work:/old/product-one
→/new/product-one
/old/blog-article
→/new/blog-article
Regular Expressions (Advanced)
You can also use regular expressions (or regex) if you need more control over your wildcard redirects. The regular expression will be evaluated from the start path + query string. If you use capture groups in the regular expression, you can refer to those capture groups as$1
in the 'Redirect to' field:
Common Use Cases
Here are a few common situations where you might need to use wildcard redirects instead of standard URL redirects:
▪️Redirect visits to all missing product detail pages
If you have unpublished a product from your store, visitors will see a 404 error page if they try to access the old product URL. You can use wildcard redirects to send all visitors to missing product pages to another page.
For example, to send all visitors to a list of your collections you can create a wildcard redirect like:
- Redirect from:
/products/$1
- Redirect to:
/collections/all
▪️Redirect all broken links to your homepage
You can redirect all broken link visits to a new URL by creating a wildcard redirect with 'redirect from' set to/$1
. Then, anytime a visitor visits a page that does not exist they will be sent to which ever page you select.
▪️Migrating to Shopify
If you are migrating to Shopify you might have a large number of URLs on your old store that no longer exist in Shopify. However you might have links to these URLs in Google, other blogs and social media sites. If these URLs follow a similar pattern you can use wildcard redirects to redirect your visitors to a new URL on your Shopify store.
For example, WooCommerce stores generally have products with URLs structured as/product/t-shirt
where as Shopify's URLs are structured as/products/t-shirt
(with the 's' on products). You could create a redirect with the following rule:
- Redirect from:
/product/$1
- Redirect to:
/products/$1
This would redirect URLs like /product/t-shirt
automatically to/products/t-shirt
so visitors could still find your products while following old links.
Uninstalling the App
Regular redirects that you create through the Link Manager are stored on Shopify and will persist even after you uninstall the app. Wildcard redirects though, require the app to function.
If you uninstall the app, wildcard redirects will no longer work.
✅ Tips and Troubleshooting
- Learn how to manage existing URL redirects
- Only regular redirects will persist if you uninstall the app - get in touch if you need guidance!
- We are able to process redirects faster than most apps so you will never see a 404 error on redirect
(lm.218)