【发布时间】:2013-11-30 05:26:05
【问题描述】:
所以我有一个用户名的重写规则如下
RewriteEngine On
RewriteBase /test/
Options FollowSymLinks
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^/?([A-Z0-9a-z\~\^\(\)_\-\+\{\}\[\]\|:\<\>\.]+)$ index.php?user=$1 [L]
这很好用,我可以 echo $_GET['user'] 没问题。当我按如下方式向重写规则添加另一个变量时会出现问题 -
RewriteRule ^/?([A-Z0-9a-z\~\^\(\)_\-\+\{\}\[\]\|:\<\>\.]+)$/?extra$ index.php?user=$1&system_page=extra [L]
我希望能够访问 http//localhost/test/username/extra 并以“extra”的结果回显 $_GET['system_page'],但我收到了 404 错误。
对此的任何帮助都非常感谢。
【问题讨论】:
标签: php .htaccess mod-rewrite get