规则 url 正则表达式
Rules url regex
我正在创建重定向规则
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>
以上规则有效,但有没有办法将两个 url 合并为一个规则而不是创建两个不同的规则?
提前致谢
这行得通吗?
<add input="{PATH_INFO}" pattern="^/overview(/(history|mission|vision))?$" />
我正在创建重定向规则
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>
以上规则有效,但有没有办法将两个 url 合并为一个规则而不是创建两个不同的规则?
提前致谢
这行得通吗?
<add input="{PATH_INFO}" pattern="^/overview(/(history|mission|vision))?$" />