我已经重写了URL,并且测试了该模式。在测试中它说它匹配,但是当我尝试该网站时它什么也没做。它只是转到现有站点。
<rule name="matchAll" enabled="true" patternSyntax="ECMAScript" stopProcessing="true">
<match url="https\://dev\.oldwebsite\.net" />
<conditions>
<add input="{HTTP_HOST}" pattern="https\://dev\.oldwebsite\.net/application\.php" negate="true" />
<add input="{HTTP_HOST}" pattern="https\://dev\.newwebsite\.com" negate="true" />
</conditions>
<action type="Redirect" url="https://dev.newwebsite.com/{R:1}" />
</rule>
新开发:我能够获得一些重定向,以用于以下工作。但是{PATH_INFO}无法正常工作。
<rules>
<clear />
<rule name="RedirectAll" stopProcessing="true">
<match url="dev.olddomain.net" />
<action type="Redirect" url="https://dev.newdomain.com" />
<conditions logicalGrouping="MatchAll">
<add input="{PATH_INFO}" pattern="application\.php" negate="true" />
<add input="{HTTP_HOST}" pattern="dev\.newdomain\.com" negate="true" />
</conditions>
</rule>
</rules>
最新测试星期二晚上9:59
<rules>
<clear />
<rule name="application.php exclusion" stopProcessing="true">
<match url="application.php" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{HTTP_HOST}" pattern="^dev\.olddomain\.net$" />
</conditions>
<action type="None" />
</rule>
<rule name="RedirectAll" enabled="true" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{HTTP_HOST}" pattern="dev\.newdomain\.com" negate="true" />
</conditions>
<action type="Redirect" url="https://dev.newdomain.com" />
</rule>
</rules>