简体   繁体   English

使用带有两个以上GET变量的.htaccess在PHP中重写URL

[英]Url rewriting in php using .htaccess with more than two GET variables

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, 目前我的htaccess如下,

 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? 如何用两个以上的GET变量重写php中的url?

Where I placed my htaccess file? 我在哪里放置了我的htaccess文件? inside the 'demo' folder or in root path? 在'demo'文件夹内或根路径中?

Please any one help... 请任何人帮忙......

像这样使用它,

RewriteRule ^my_list\.php/([^/]+)/([^/]+)$ my_list.php?id=$2&name=$1 [L]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM