-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,451
  • 5
  • 15
  • 16
  • 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
  • 40,709
  • 21
  • 93
  • 115
Majid Abbasi
  • 1,531
  • 3
  • 12
  • 22