如何解决如何在web.confg中将url重定向到localhost上的ssl url
localhost:5011是url,而localhost:44330是SSL url。我想在我的web.config中将http:// localhost:5011重定向到https:// localhost:44330。我为此找到了规则,但是它并没有按照我的意愿工作:
<rule name="Redirect local requests to https" stopProcessing="true">
<match url="(localhost:5011*)" />
<conditions logicalGrouping="MatchAny">
<add input="{HTTPS}" pattern="off" ignoreCase="true" />
</conditions>
<action type="Redirect" url="https://localhost:44330/" redirectType="Permanent" appendQueryString="true" />
</rule>
这将重定向到https:// localhost:5011。我该如何解决?
解决方法
我认为您的角色不会重定向,因为 如果您需要将http:// localhost:5011重定向到https:// localhost:44330,请尝试使用此规则 II不应将http:// localhost:5011重定向到https:// localhost:5011,因此请检查您是否有其他重写规则,或者您的应用程序是否在执行相同的工作。 <rule name="Redirect local requests to https" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAll">
<add input="{HTTPS}" pattern="off" />
<add input="{HTTP_HOST}" pattern="localhost" />
<add input="{SERVER_PORT}" pattern="^5011$" />
</conditions>
<action type="Redirect" url="https://localhost:44330/" redirectType="Permanent" appendQueryString="true" />
</rule>
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。