Should I include my search term in my search path or as a parameter?

233 Views Asked by At

I'm building a search page for my website. I see that traditionally search terms are included as parameters- i.e. /search?q=lady+gaga this is observed on pretty much every site I've encountered- including Google, Pinterest, Twitter, and stack overflow.

I'm wondering what the advantages to this are over a search route like /search/lady-gaga. It seems like including the search term in the path would have advantages for SEO, and OpenGraph (when my search results page would be pasted into facebook, the snippet pulled in by facebook could be customized for the search term in question).

Basically- it would seem that search terms encoded into the url path would be a better practice than a parameter- but it seems that everyone does it as a parameter. Am I missing something?

1

There are 1 best solutions below

0
On

General Google didn't crawl the forms and it can't submit values to the form and index its results, so Google will not access these pages /search?q=lady+gaga unless these is backlinks pointing to these pages.

Now what is best regarding to URL structure, it depends is you want to use the search pages for example (most searched terms on our website) and list them anywhere in the website, here you should use the second option you talked about which is /search/lady-gaga.