具有多个&符号的Apache RewriteRule

时间:2013-06-27 20:28:12

标签: mod-rewrite

我需要做些什么:

请求:

http://site.com/ipdb/remote&url=http%3A%2F%2Fsite.com%2F&shortname=X

规则:

RewriteRule ^remote&url=(.+?)&shortname=(.+?)$ /ipdb/?request=remote-access&url=$1&shortname=$2 [L]

以上规则不起作用。任何解决方案?

我在做什么:

请求:http://site.com/ipdb/dwnlds&dl=X

规则:

RewriteRule ^dwnlds&dl=(.+?)$ /ipdb/?request=downloads&download=$1

1 个答案:

答案 0 :(得分:0)

尝试使用QSA旗帜

AllowEncodedSlashes On

RewriteRule ^ipdb/remote$ /ipdb/?request=remote-access [B,QSA,L]

好的我觉得我现在得到你需要的东西。 您应该能够完全隐藏request = remote-access 做点什么。

RewriteRule access/(.*)/(.*) /ipdb/?request=remote-access&url=$1&shortname=$2&%{QUERY_STRING}$ [L]

然后您应该能够将链接指定为http://localhost/access/mysite.com/ppl

相关问题