I’m trying to redirect a search result URL (ie /search?q=search+term* ) to a collection page (ie /collections/search-term )
I’m using the redirects in the store navigation, but having no luck. Is it not possible? Do I need to use an alternate method?
Thanks
I don’t think you can redirect per url params on the search endpoint.
And you really shouldn’t try that without alot of forethought or your gonna risk customers who are casually searching getting constantly redirected because greedy redirects match what ever ambiguous term they are using.
Say your a clothing store with a shirts collection it’s not uncommon for customers to just type something like “shirt” so they can get to the search page where they often expect there to be filters they can uses to get more precise results they want, with your redirect greedily matching “tshirt” they get auto redirected and you rob your customer of agency.
You’ll be better off either trying the return_to parameter on the search form, or adding a html meta redirect or a javascript based redirect.
On the search template you should still show a direct link to that collection so when the user needs to they choose to navigate.