【问题标题】:URL rewrite not showing effectURL重写不显示效果
【发布时间】:2016-04-04 11:57:50
【问题描述】:

我在使用 tukey 过滤器 4.0 的 struts 应用程序的 urlrewrite.xml 文件中编写了以下规则。我们在应用程序中有一个要求,即 http:localhost:8080/tgld/viewTopic?guidelinename=A&topicFile=B 类型的 URL 需要替换为 http:localhost:8080/tgld/etg/topicFile 类型的 URL。对原始 URL 进行某种掩蔽,因为它看起来很糟糕,有这么多参数。 URLrewrite jar 4.9 已经在 WEB-INF 中,我的 http://localhost:8080/rewrite-status 页面加载正常。

这里 tgld 是应用程序上下文,viewTopic 是我的操作名称

如果有人能在这里帮助我们,那就太好了

   <rule>
        <from>/viewTopic/*</from>
        <to>/etg/$2</to>
     </rule>

【问题讨论】:

    标签: url-rewriting


    【解决方案1】:

    请更改规则如下

    <rule>
        <from>^/viewTopic?guidelinename=(.*)&topicFile=(.*)$</from>
        <to type="redirect">/tgld/etg/$2</to>
    </rule>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2010-11-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-08-03
      相关资源
      最近更新 更多