【问题标题】:UrlRewriteFilter: remove parametersUrlRewriteFilter:删除参数
【发布时间】:2011-07-08 08:42:48
【问题描述】:

我有一个类似 example.com/sample.html?h=22&w=23 的网址

如何使用 UrlRewriteFilter 从该 URL 中删除参数并使用 URL example.com/sample.html 重定向请求?我需要删除这些参数,因为我的应用程序(托管在 Tomcat 上)不处理这些。

【问题讨论】:

    标签: url-rewriting


    【解决方案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>
    

    您可能希望使用转发而不是重定向,这取决于我们的情况。

    【讨论】:

      猜你喜欢
      • 2012-04-18
      • 1970-01-01
      • 2012-01-23
      • 1970-01-01
      • 2016-04-18
      • 1970-01-01
      • 1970-01-01
      • 2010-10-06
      • 2016-06-10
      相关资源
      最近更新 更多