Redirect 两个重定向,而不是小写的一个重定向

Redirect 两个重定向,而不是小写的一个重定向,redirect,iis,Redirect,Iis,将以下规则添加到重定向文件时: 到“”,然后从“”返回到“”,状态为302 有没有办法修改此规则以只进行一次重定向?根据您在评论中的回答,您只需在规则中指定域名即可避免多次重定向。例如: <rule name="To Lowercase" enabled="true" stopProcessing="true"> <match url=".*[A-Z].*" ignoreCase="false" /> <conditions> <ad

将以下规则添加到重定向文件时:


到“”,然后从“”返回到“”,状态为302


有没有办法修改此规则以只进行一次重定向?

根据您在评论中的回答,您只需在规则中指定域名即可避免多次重定向。例如:

<rule name="To Lowercase" enabled="true" stopProcessing="true">
  <match url=".*[A-Z].*" ignoreCase="false" />
  <conditions>
    <add input="{REQUEST_URI}" pattern="^/Images/" negate="true" />
    <add input="{REQUEST_METHOD}" pattern="GET" ignoreCase="true" />
  </conditions>
  <action type="Redirect" url="https://www.foo.com/{ToLower:{R:0}}" redirectType="Permanent" />
</rule>

<rule name="Redirect to WWW">
  <match url=".*" />
  <conditions>
    <add input="{HTTP_HOST}" pattern="^foo.com$" />
  </conditions>
  <action type="Redirect" url="https://www.foo.com/{R:0}" redirectType="Permanent" />
</rule> 


web.config中是否有其他规则?看起来是另一个规则导致重定向是的,还有另一个-我已将其添加到上面的代码块中。因此,基本上,您有三个“规则”:小写、强制www和强制https。是否正确?嗨,Victor,是的,负载平衡器级别也有强制https