2010-10-15 71 views
1

现在即时通讯使用以下htaccess的多个GET变量

说我的错误是一个无效的用户名,我重定向到domain.com/error/username

RewriteRule ^error/(.+)$/ index.php?switch=error&errortype=$1 [L] 
发送我的错误给我的脚本

但我说我也想通过错误的价值,我试着下面,但它看起来不是正确的方式。重定向到:domain.com/error/username/thisisnotauser

RewriteRule ^error/(.+)$/(.+)$/ index.php?switch=error&errortype=$1&errorid=$2 [L] 

回答

0

您的规则可能是正确的,但在你的.htaccess文件规则的顺序是非常重要的。

他们应该在这个顺序...

RewriteRule ^error/(.+)$/(.+)$/ index.php?switch=error&errortype=$1&errorid=$2 [L] 
RewriteRule ^error/(.+)$/ index.php?switch=error&errortype=$1 [L] 
0

你的正则表达式的URI为年底前$,第二有两个$

也作为@索尼提到,你可能会想要颠倒的顺序。