我有此代码:
RewriteEngine on
RewriteRule (.*).php review.php?site=$1 [L]
我想从中得到:
http://m.example.com/sandbox/mates.php
:
http://m.example.com/sandbox/review.php?site=mates
但是它不起作用。请注意,我的htaccess root文件在目录内而不是根部。
您的root .htaccess如果您有一个可能会给您带来冲突的问题。
您也可能想将规则更改为
RewriteRule ^(.*).php$ review.php?site=$1 [L]
您也可以更加明确:
RewriteRule ^(.*).php$ /sandbox/review.php?site=$1 [L]