I have a search form using GET request. When I hit enter, the url is as usual not SEO friendly, is there a way in which I can make it display SEO friendly urls when entered?
Eg.
GET Request http://someurl.com?a=search&query=what+are+you+looking+for
SEO URL should be http://someurl.com/search/what+are+you+looking+for
I already created a rule
RewriteRule ^search/(w+) index.php?a=search&query=$1
in my .htaccess that works when I manually type the SEO Url into the address bar. So I guess it’s only a matter of making sure when I hit enter inside the search field, it loads the SEO Url instead of the other.
3
Answers
You can use this in your
.htaccess
:This will leave you with the URL:
http://someurl.com/search/what+are+you+looking+for
You have to redirect your orignal uri to the new uri , add the followng before your existing rule :
I do this on my way 🙂
This is the form for search
Before form
And in
.htaccess