【发布时间】:2017-12-01 22:24:58
【问题描述】:
我想使用 web.config 将我的 asp.net 站点上的所有请求重定向到非 www 的 https://。那就是:
http://
http://www
https://www
应该都去
https://
到目前为止,我的 web.config 有这个:
<system.webServer>
...
<rewrite>
<rules>
<clear />
<rule name="Redirect to https" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTPS}" pattern="off" ignoreCase="true" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="Permanent" appendQueryString="false" />
</rule>
</rules>
</rewrite>
</system.webServer>
上面的 sn-p 负责重定向这两个:
http://
http://www
但我错过了最后一个,即:
https://www ---> https://
怎么做?
【问题讨论】:
标签: c# asp.net iis https web-config