【发布时间】:2017-09-05 07:24:20
【问题描述】:
我在 web.config 中创建了一个重定向规则,将我的网站从 http 重定向到 https。我遇到的问题是网站上的每个链接现在都是 https。我有很多指向其他没有 SSL 的网站的链接,因此我收到证书错误。这就是我所做的:
<rewrite>
<rules>
<rule name="HTTP/S to HTTPS Redirect" enabled="true" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAny">
<add input="{SERVER_PORT_SECURE}" pattern="^0$" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Permanent" />
</rule>
</rules>
</rewrite>
我怎样才能只为我的域而不是我网站上的每个链接重定向 https?
【问题讨论】:
-
这毫无意义。仅重写进入服务器的更改请求。它不会改变从服务器返回的 html 响应。
标签: asp.net asp.net-mvc ssl redirect asp.net-core