https://www.subdomain.domain.com到https://subdomain.domain.com重定向

时间:2017-06-09 17:00:58

标签: redirect iis dns iis-8

我的老板希望确保我们的互联网挑战用户能够通过在浏览器的地址栏中输入以下内容来访问特定的子域名https://subdomain.domain.com

https://www.subdomain.domain.com

好像我能够做HTTP - >使用IIS的重写模块进行HTTPS重定向没有问题。此外,我似乎能够使用重写模块将WWW.subdomain.domain.com添加到subdomain.domain.com。然而,将它们结合起来证明是困难的。因此,当用户在浏览器https://www.subdomain.domain.com中键入最终因隐私警告而失败时(我们的通配符证书是* .domain.com)。

我已经设置了一个CNAME记录,将www.subdomain.domain.com指向subdomain.domain.com的A记录。我已经为IIS中的每一种组合设置了绑定(有/无https,有/无www)。

我在网站的配置中有以下内容:

<system.webServer>
    <rewrite>
          <rules>
            <clear />
            <rule name="Remove WWW" patternSyntax="Wildcard" stopProcessing="false">
                    <match url="*" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
                        <add input="{CACHE_URL}" pattern="*://www.*" />
                    </conditions>
                    <action type="Redirect" url="{C:1}://{C:2}" redirectType="Permanent" />
                </rule>
                <rule name="http to https" stopProcessing="true">
                    <match url="(.*)" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="true">
                        <add input="{HTTPS}" pattern="^OFF$" />
                    </conditions>
                    <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="SeeOther" />
                </rule>
            </rules>
        </rewrite>
</system.webServer>

似乎我无法让浏览器喜欢从https://www.subdomain.domain.comhttps://subdomain.domain.com的重定向。在浏览器尝试提供www.subdomain.domain.com之前,为什么不进行重写。这甚至可能吗?

0 个答案:

没有答案
相关问题