I am trying to convert my URL in to SEO Friendly url. I do not have much knowledge about htaccess rewrite rules, URL is:
https://www.zesteve.com/search.php?loc=Guntur&q=manjunath-cake-shop
the URL should be
https://www.zesteve.com/Guntur/manjunath-cake-shop
I have tried this:
RewriteEngine On
RewriteCond $1 ^search
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ search.php?q=$1 [L,QSA]
I got the result as
https://www.zesteve.com/search?loc=Guntur&q=manjunath-cake-shop
Edit
I am using jquery to redirect
window.location.href = 'search?loc=' + location[0] + '&q='+ search_term;
3
Answers
If any body look for same solution. Here is my answer
First it should redirect and convert to SEO Friendly URL
and now Set URL
It solved my problem.
above URL is now
I don't want to show search.php page in URL
Use this in your
.htaccess
file:It will leave you with the URL:
https://www.zesteve.com/Guntur/manjunath-cake-shop
. Just make sure you clear your cache before you test this.