首页 > 解决方案 > Windows IIS 将 domain.de 转发到 www.domain.de

问题描述

在我开始之前,我尝试了搜索栏并看到了帖子,但这些并没有真正帮助我。

所以我目前正试图转发我的域以强制使用 HTTPS 和 www。

就像我输入 mydomain.de 时一样,它会将我转发到https://www.mydomain.de

这是我的 web.config

    <?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="http to https secure" stopProcessing="true">
                    <match url="(.*)" />
                    <conditions>
                        <add input="{HTTPS}" pattern="^OFF$" />
                        <add input="{HTTP_HOST}" pattern="^(www.)?speargaming.de" />
                    </conditions>
                    <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="SeeOther" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>

我没有看到我在那里做错了什么。

标签: windowshttpiishttpsserver

解决方案


推荐阅读