【问题标题】:"Exceptional" rule for Tuckey URL Rewrite FilterTuckey URL 重写过滤器的“例外”规则
【发布时间】:2015-01-05 20:50:33
【问题描述】:

伙计们!我正在使用 Tuckey URL 重写过滤器,我希望所有那些 not 以“/specialUrl/”开头的请求现在都以“/prefixUrl/”为前缀。例如:

  • “/specialUrl/xxx”保持原样(“/specialUrl/xxx”),但是
  • “/otherUrl/xxx”转换为“/prefixUrl/otherUrl/xxx”;
  • “/xxx”也转换为“/prefixUrl/xxx”。

我应该如何描述这样的规则?

【问题讨论】:

    标签: regex redirect tuckey-urlrewrite-filter


    【解决方案1】:

    你可以使用这条规则:

    <rule match-type="regex">
      <condition name="request-uri" operator="notequal">^/specialUrl/.*$</condition>
      <from>^/(.*)$</from>
      <to type="permanent-redirect">/specialUrl/$1</to>
    </rule>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-03-25
      • 2011-07-20
      • 2011-04-10
      • 2014-10-05
      • 1970-01-01
      • 2018-11-21
      相关资源
      最近更新 更多