0
我想隐藏.php扩展名,并且还用尾部斜线重写了url字符串。文件扩展名隐藏工作正常,但url字符串不是。htaccess文件扩展名隐藏和传递url字符串
来源:
http://www.example.com/abc.php?id1=1&id2=2
要:
http://www.example.com/abc/id1/1/id2/2
以下是我的.htaccess
RewriteEngine On
Options -Multiviews
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^\.]+)$ $1.php [NC,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{QUERY_STRING} (.*)
RewriteRule ^(.*)\/([0-9]+)$ $1.php?id=$2&%1 [L]