Redirect web.config中的HTTPS重定向导致错误\u太多\u重定向
我正在尝试在web.config中添加重定向规则,以便只使用HTTPS提供我的网页,而不使用HTTP;到目前为止,我已经使用了这个规则集(以及我的404重定向):Redirect web.config中的HTTPS重定向导致错误\u太多\u重定向,redirect,https,web-config,Redirect,Https,Web Config,我正在尝试在web.config中添加重定向规则,以便只使用HTTPS提供我的网页,而不使用HTTP;到目前为止,我已经使用了这个规则集(以及我的404重定向): ,和。可能我来这里晚了一点,但以下重写规则有助于解决重定向错误: <rule name="Redirect to https" stopProcessing="true"> <match url="(.*)" /> <conditions logicalGrouping="MatchAny" t
,和。可能我来这里晚了一点,但以下重写规则有助于解决重定向错误:
<rule name="Redirect to https" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAny" trackAllCaptures="false">
<add input="{HTTP_HOST}" pattern="^example\.com$" />
<add input="{SERVER_PORT}" pattern="^80$" />
</conditions>
<action type="Redirect" url="https://www.example.com/{R:1}" appendQueryString="true" redirectType="Permanent" />
</rule>
也许我来这里晚了一点,但以下重写规则有助于解决重定向错误:
<rule name="Redirect to https" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAny" trackAllCaptures="false">
<add input="{HTTP_HOST}" pattern="^example\.com$" />
<add input="{SERVER_PORT}" pattern="^80$" />
</conditions>
<action type="Redirect" url="https://www.example.com/{R:1}" appendQueryString="true" redirectType="Permanent" />
</rule>