-1

I have the following url:

http://example.com/cars.php?category=suv?car_title=benz

I want the url to look like this:

http://example.com/cars/suv/benz

Alex
  • 1,271
  • 4
  • 13
  • 15
  • Possible duplicate of [Remove .php extension with .htaccess](http://stackoverflow.com/questions/4026021/remove-php-extension-with-htaccess) – izk May 24 '16 at 10:47
  • this question has alot of answers already on stackoverflow. – izk May 24 '16 at 10:48

1 Answers1

2

You can use from this structure in your htaccess file:

Options +FollowSymLinks
RewriteEngine on
RewriteRule ^cars/(.*)/(.*)/?$ /car.php?category=$1&car_title=$2 [NC,L]
Amit Verma
  • 39,545
  • 18
  • 87
  • 107
Majid Abbasi
  • 1,521
  • 2
  • 11
  • 22