IIS URL重写规则从http到https的子域

时间:2018-08-23 08:34:16

标签: iis-8 url-rewrite-module

我尝试了多种IIS重写规则将我的子域重定向到https。 问题:如何使子域http://test.example.com重定向到https://test.example.com。为了提供更多信息,子域不是文件夹,而是隔离的网站。低于规则对我不起作用。

<rule name="HTTP to HTTPS" stopProcessing="true">
    <match url="(.*)" />
    <conditions logicalGrouping="MatchAll">
        <add input="{HTTPS}" pattern="^off$" ignoreCase="false" />
    </conditions>
    <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Permanent" />
</rule>

仅供参考:它在我的生产网站上正常运行,因为我可以在其中写出www.的条件。

0 个答案:

没有答案