"Exceptional" Tuckey URL 重写筛选器的规则



伙计们!我正在使用Tuckey URL重写筛选器,我希望所有以"/specialUrl/"开头的请求现在都以"/prefixUrl/"为前缀。例如:

  • "/specialUrl/xxx"保持原样("/specicalUrl/xxxx"),但是
  • "/otherUrl/xxx"转换为"/prefixUrl/otherUrl.xxx"
  • "/xxx"也转换为"/prefixUrl/xxx"

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

您可以使用以下规则:

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

最新更新