开发者

How do I rewrite a URI to a destination with a query string [duplicate]

This question already has answers here: How do I preserve the existing query string in a mod开发者_运维知识库_rewrite rule (2 answers) Closed 8 years ago.

We are trying to redirect bin-ends2 to wines.jsp with a number of parameters passed over to the application server. Apache is stripping the parameters off and so the application server fdoes not know what yo put in the page. The Apache config is:

RewriteRule ^/wines/bin-ends2$ http://qa2:7025/wines/wines.jsp?Form=WinesSearch&type=binends [PT]

Does anyone know how to make this work?


You need to add QSA flag to your rule when you introduce new query string parameters and would like to preserve (better say, include) existing query string.

Your rule should be

RewriteRule ^/wines/bin-ends2$ http://qa2:7025/wines/wines.jsp?Form=WinesSearch&type=binends [QSA,PT]

Useful link: http://httpd.apache.org/docs/current/rewrite/flags.html#flag_qsa

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜