对于这种情况,设置 .htaccess 似乎很困难。对于约会网站,我们有这种情况:
We assume john is logged in:
domain.com/john //this works no problem
domain.com/?askout=yes&when=later //this doesn't work, if john is logged in and pastes
this url, it automatically redirects to domain.com/john
instead, htaccess should see the ? and know it's
not a valid user. It should keep the entire query,
and redirect to /profiles.php?askout=yes&when=later
这是.htaccess:
RewriteRule ^(\w+)/?$ ./profiles.php?username=$1
基本上,我需要让 .htaccess 立即知道?表示不使用上述重写规则。知道如何做到这一点吗?