【发布时间】:2017-12-21 16:52:16
【问题描述】:
我的 web.config 中有以下内容来强制 https;
<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>
但我想强制 www。同样,所有这些都将转到https://www 版本。我需要达到的目标:
http://www.domain.tld/whatever
http://(no-www)domain.tld/whatever
https://(no-www)domain.tld/whatever
谢谢。
【问题讨论】:
-
@cfnerd 嗨,我首先使用了它,但它不包括如何强制 www。部分。