How to redirect search query to main search page

Explorer
63 0 3

Using debut - my goal is to hide all of my website's pages from internal search (this question is not about search engine results). I have used this code in  my search.liquid, and search-form.liquid to hide pages from coming up:

<input type=hidden name=type value="product,article">

 However, I would also like to ensure that pages cannot be searched by entering the page name in the url to search:
https://mywebsite.com/search?type=pages&q=some-page

 

Can I use a redirect like this? It doesn't seem to be working?

Redirect from:

/search?q=*&type=pages

to

https://mywebsite.com/search

 

If not does anyone have any other solutions? Thanks!

0 Likes