规则网址正则表达式

时间:2019-03-11 01:53:08

标签: regex redirect rules

我正在创建重定向规则

www.<url>.com/overview           to   www.<url>.com/history
www.<url>.com/overview/history   to   www.<url>.com/history

  <rule name="Overview" enabled="true" stopProcessing="true">
    <match url=".*" />
    <conditions>
      <add input="{PATH_INFO}" pattern="^/overview" />
    </conditions>
    <action type="Redirect" url="www.<url>.com/history" appendQueryString="false" />
  </rule>

  <rule name="Overview-History" enabled="true" stopProcessing="true">
    <match url=".*" />
    <conditions>
      <add input="{PATH_INFO}" pattern="^/overview/history" />
    </conditions>
    <action type="Redirect" url="www.<url>.com/history" appendQueryString="false" />
  </rule>

上述规则有效,但是是否有办法将两个网址合并为一个规则,而不是创建两个不同的规则?

预先感谢

0 个答案:

没有答案