UrlRewriteFilter: remove parameters

☆樱花仙子☆ 提交于 2019-12-02 22:22:40

问题


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

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.


回答1:


<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.



来源:https://stackoverflow.com/questions/6622018/urlrewritefilter-remove-parameters

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!