Php htaccess变量不能与用户名一起使用

Php htaccess变量不能与用户名一起使用,php,.htaccess,mod-rewrite,get,Php,.htaccess,Mod Rewrite,Get,所以我有一个用户名重写规则,如下所示 RewriteEngine On RewriteBase /test/ Options FollowSymLinks RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{QUERY_STRING} ^(.*)$ RewriteRule ^/?([A-Z0-9a-z\~\^\(\)_\-\+\{\}\[\]\|:\<\>\.]+)$ index.php?user=$1 [L] 重新编写引擎打开

所以我有一个用户名重写规则,如下所示

RewriteEngine On
RewriteBase /test/

Options FollowSymLinks
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{QUERY_STRING} ^(.*)$

RewriteRule ^/?([A-Z0-9a-z\~\^\(\)_\-\+\{\}\[\]\|:\<\>\.]+)$ index.php?user=$1 [L]
重新编写引擎打开
重写基础/测试/
选项如下符号链接
重写cond%{REQUEST_FILENAME}-F
RewriteCond%{QUERY_STRING}^(.*)$
重写规则^/?([A-Z0-9a-z\~\^(\)\U\-\+\\\\\\[\]\\\\\\\\\\\.]+)$index.php?用户=$1[L]
这很好,我可以回显$\u GET['user']没问题。当我将另一个变量添加到重写规则时,会出现如下问题-

RewriteRule ^/?([A-Z0-9a-z\~\^\(\)_\-\+\{\}\[\]\|:\<\>\.]+)$/?extra$ index.php?user=$1&system_page=extra [L]
RewriteRule^/?([A-Z0-9a-z\~\^(\)\\\+\\\\\\\\\\\[\]\\\\\\\:\\.]+)$/?额外$index.php?用户=$1,系统页面=额外[L]
我希望能够转到http//localhost/test/username/extra并返回$\u GET['system\u page'],结果是“extra”,但我收到了一个404错误


非常感谢您在这方面的帮助。

好的,我想好了。对于遇到相同问题的任何人,解决方案是删除用户名定义后的“$”

RewriteRule ^/?([A-Z0-9a-z\~\^\(\)_\-\+\{\}\[\]\|:\<\>\.]+)$/?extra$
RewriteRule^/?([A-Z0-9a-z\~\^\(\)\U\-\+\\\\\\\\\\[\]\\\\\\\;:\\.]+)$/?额外$
应改为-

RewriteRule ^/?([A-Z0-9a-z\~\^\(\)_\-\+\{\}\[\]\|:\<\>\.]+)/?extra$
RewriteRule^/?([A-Z0-9a-z\~\^(\)\\-\+\\\\\\\\\\[\]\\\\\\\\;:\\.]+)/?额外$