Currently I have my search page hosted like below
mywebsite.com/search.html?query=cat
So I am extracting query from url parameter as you can see the query is 'cat'
for now.
For some seo reasons this is not a good practice so I want to replace above format to following format:
mywebsite.com/search/cat
Is there any way to achieve such result without actually changing the current files? Right now I am hosting the website with nginx
in ubuntu
server. Any suggestion is hugely appreciated.
Thanks in advance
2
Answers
There are thousands of examples for this in SO.
Nevertheless here is a suggestion:
You can simply do the following rewrite in your NGINX configuration (in
server {...}
block):