Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hi,
I am using Dawn. The following code is working well to redirect from /collections to another URL.
However when I add /collections/all, the website won't redirect from either /collections or /collections/all.
How can I add /collections/all?
I can't use the Shopify default redirect function because it will change the letter from "?" to "_".
Thank you in advance.
{% if request.path == '/collections' %}
<script>
window.location.href = '/collections/all?pf_st_fan_mai_zhuang_kuang=in-stock';
</script>
{% endif %}
is there any specific reason that you don't want to verify the path with javascript instead of liquid? I know liquid is better for performance, but since your situation is very specific, maybe using javascript could do the trick
Thanks for your reply. I don't mind JavaScript or Liquid.
Learn how to expand your operations internationally with Shopify Academy’s learning path...
By Shopify Feb 4, 2025Hey Community, happy February! Looking back to January, we kicked off the year with 8....
By JasonH Feb 3, 2025Expand into selling wholesale with Shopify Academy’s learning path, B2B on Shopify: Lau...
By Shopify Jan 28, 2025