Does anyone know whether regular expressions or similar are supported in the Shopify URL Redirect?
I need to add a URL Redirect in Shopify that uses a regular expression (or similar) to capture the product handle from the Shopify URL and insert it into the redirect URL, which happens to be a URL outside of Shopify. For example, my original URL is https://my-company.myshopify.com/store/item-1, and I need to redirect it to https://my-company.co/store/item-1. ;
I'd like to do this with a regular expression because I have over 100 items, and I do not want to add them all and have to maintain the list every time a new product is added to Shopify.
I am able to add URL redirects for static URLs successfully, using the guide here. https://docs.shopify.com/manual/your-website/navigation/url-redirect
However, I am unable to capture a part of the original and re-use it in the redirect URL successfully. I have tried variations of the following, but I would expect that if regular expressions are supported, they would function like an .htaccess file. And the first regular expression has been proven to work in an .htaccess file. Is there another mechinism that would function similarily that Shopify supports?
All attempts have resulted in a 404 result on Shopify's end instead of a redirect.
Hi Shane. Thank you for your reply. Fwiw, as a workaround I created a little Node app which cycles through all of the products in my Shopify store and creates the necessary URL redirects using the Shopify API. Anytime a new product is added to the store, we trigger the program to run for the new product. This was a nice alternative to avoid manually creating the redirects, although regex support would still be a nice option. Thanks in advance for keeping the thread updated should this feature enter the roadmap.