开发者

mod_rewrite to match URL as parameter

I'm trying to use mod_rewrite to pass a full unescap开发者_JS百科ed URL as a parameter, like so:

http://domain-a.com/http://domain-b.com/

I've achieved this using the technique outlined in this post, which suggested the following rewrite rule:

RewriteRule ^http:/(.*)/?$ http://domain-a.com/index.php?u=http://$1 [L,NE,QSA]

While I know this is something of a hack (given that the second URL should be encoded), I would like to know if it is possible to allow the same mod_rewrite rule to accept and pass along query strings, like so:

http://domain-a.com/http://domain-b.com/?sort=new


I'm pretty sure it's impossible to do that, because how would mod_rewrite know whether the querystring was for domain-a or should be rewritten as a part of the domain-b url?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜