.net IIS HTTPS无限重定向
我的网络配置中的HTTPS重定向配置有问题:.net IIS HTTPS无限重定向,.net,redirect,iis,https,.net,Redirect,Iis,Https,我的网络配置中的HTTPS重定向配置有问题: <rewrite> <rules> <rule name="Redirect to HTTPS" stopProcessing="true"> <match url="(.*)" /> <conditions> <add input="{HTTP_HOST}" pattern="^domain\.b
<rewrite>
<rules>
<rule name="Redirect to HTTPS" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTP_HOST}" pattern="^domain\.be$" negate="true" />
<add input="{HTTPS}" pattern="OFF" ignoreCase="true" />
</conditions>
<action type="Redirect" url="http://www.domain.be/{R:1}" />
</rule>
<rule name="Redirect to WWW" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAny">
<add input="{HTTP_HOST}" pattern="^domain\.be$" />
</conditions>
<action type="Redirect" url="https://www.domain.be/{R:0}" redirectType="Permanent" />
</rule>
</rules>
</rewrite>
domain.be
但不适用于:
- www.domain.be
当我转到那个URL时,总是会出现无限的重定向错误
有人能指出我在web.config中的错误吗
提前感谢此规则可用于将非HTTPS和非www.domain.be的所有内容发送到
您可能需要检查说明如何在IIS中测试重写规则的内容。我也可以看到一个矛盾;你说重定向到HTTPS,但重定向到HTTP。
<rewrite>
<rules>
<rule name="redirect to https www" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAny">
<add input="{HTTP_HOST}" pattern="^www\.domain\.be$" negate="true" />
<add input="{HTTPS}" pattern="ON" ignoreCase="true" negate="true" />
</conditions>
<action type="Redirect" url="https://www.domain.be/{R:0}" />
</rule>
</rules>
</rewrite>