1

My URL is :

 http://example.com/demo/my_list.php?id=122&name=test files

Wan't to change this into:

 http://example.com/demo/my_list.php/test files/122

Currently My htaccess is as followes,

 RewriteEngine on

 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule ^([^/]+)$ index.php?id=$1 [L]

 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule ^([^/]+)/([^/]+)$ my_list.php?id=$1&name=$2 [L]

but its not working...

How to rewrite url in php with more than two GET variables?

Where I placed my htaccess file? inside the 'demo' folder or in root path?

Please any one help...

Renjitha22
  • 213
  • 1
  • 7
  • 22

1 Answers1

0

Use it like this,

RewriteRule ^my_list\.php/([^/]+)/([^/]+)$ my_list.php?id=$2&name=$1 [L]
Abhishek Gurjar
  • 7,426
  • 10
  • 37
  • 45