Redirect from /collections and /collections/all to another URL

Topic summary

A Dawn theme user is attempting to redirect both /collections and /collections/all URLs to another destination. Their current Liquid code successfully redirects /collections alone, but stops working when they add /collections/all to the condition. \n\nKey constraint: They cannot use Shopify’s default redirect function because it converts \

Summarized with AI on November 12. AI used: claude-sonnet-4-5-20250929.

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' %}
  
{% 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.