Ranjeet Kumar
Ranjeet Kumar

Reputation: 27

Rewrite URL in SEO url

My site has URL like this

www.abc.com/search?service=computer

I want

www.abc.com/service/computer

Tried htaccess file is:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php
RewriteRule ([^/\.]+)/([^/\.]+)/?$ search.php?type=$1&service=$2

Thanks, Please help me to write this URL in SEO URL

Upvotes: 1

Views: 177

Answers (1)

RavinderSingh13
RavinderSingh13

Reputation: 133428

Please keep your htaccess file inside root folder/directory and try following rules. Please make sure to clear your browser cache before testing your URLs.

RewriteEngine ON
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]*)/([^/]*)/?$  search?$1=$2 [L]

Upvotes: 2

Related Questions