I have updated our site’s collection pages to not append the /collection/collection-name/ to our product URLs. They’re listed as “sitename.com/products/product-name” but going through a collection page it looks like “sitename.com/collection/collection-name/products/product-name.” While that has been resolved, we have a lot of posts on the website that contain links to products and are split between long and short URLs.
Is there a way to create a URL redirect script using Liquid variables to automatically redirect from the long to the short version? If it matters, we are using Dawn. Thank you!