gpt4 book ai didi

asp.net - http到https重写了太多的重定向循环IIS 7

转载 作者:行者123 更新时间:2023-12-03 14:35:37 25 4
gpt4 key购买 nike

我有在IIS 7.0中托管的应用程序。
我必须确保它仅适用于HTTPS而不适用于HTTP
所以我在根配置中包含了以下规则。

<rewrite>
<rules>
<rule name="HTTP to HTTPS redirect" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="off" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="Found" />
</rule>
</rules>
</rewrite>

在尝试访问应用程序时添加此规则后,出现以下错误:

Page has resulted in too many redirects. Clearing your cookies for this site or allowing third-party cookies may fix the problem. If not, it is possibly a server configuration issue and not a problem with your computer. Here are some suggestions: Reload this web page later. Learn more about this problem.

最佳答案

输入以下条件:

<add input="{HTTPS}" pattern="on" /> 

代替:
<add input="{HTTPS}" pattern="off" />

关于asp.net - http到https重写了太多的重定向循环IIS 7,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32523540/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com