【发布时间】:2011-07-08 08:42:48
【问题描述】:
我有一个类似 example.com/sample.html?h=22&w=23 的网址
如何使用 UrlRewriteFilter 从该 URL 中删除参数并使用 URL example.com/sample.html 重定向请求?我需要删除这些参数,因为我的应用程序(托管在 Tomcat 上)不处理这些。
【问题讨论】:
标签: url-rewriting
我有一个类似 example.com/sample.html?h=22&w=23 的网址
如何使用 UrlRewriteFilter 从该 URL 中删除参数并使用 URL example.com/sample.html 重定向请求?我需要删除这些参数,因为我的应用程序(托管在 Tomcat 上)不处理这些。
【问题讨论】:
标签: url-rewriting
<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>
您可能希望使用转发而不是重定向,这取决于我们的情况。
【讨论】: