开发者

UrlRewriteFilter: remove parameters

开发者 https://www.devze.com 2023-03-18 00:41 出处:网络
I have a URL like example.com/sample.html?h=22&w=23开发者_C百科 How can use UrlRewriteFilter to remove the params from this URL and redirect the request with the URL example.com/sample.html? I ne

I have a URL like example.com/sample.html?h=22&w=23

开发者_C百科

How can use UrlRewriteFilter to remove the params from this URL and redirect the request with the URL example.com/sample.html? I need to remove the params because my application (hosted on Tomcat) does not handle these.


<urlrewrite>
    <rule>
        <note>Forward calls from sample.html to sample.html with no query_string</note>
        <from>^/sample.html$</from>
        <to type="redirect" last="true">/sample.html</to>
    </rule>
<urlrewrite>

you might want to use forward rather than redirect, depends on our circumstances.

0

精彩评论

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