【问题标题】:Binding a certificate or redirecting root domain to www绑定证书或将根域重定向到 www
【发布时间】:2020-03-10 16:53:32
【问题描述】:

我配置了 Azure 应用服务托管 SSL 证书,该证书绑定到我的应用服务域 www.mydomain.io(IP SSL 绑定)。我希望我的根 domain.io 重定向到 www.mydomain.io 或将其绑定到同一个证书。我可以在 Azure 门户或我的域提供商 (GoDaddy) 中进行配置吗?还是我需要为我的根域购买单独的 SLL 证书?

我尝试通过以下方式配置 web.config,但没有成功:

 <rule name="Redirect old-domain to new-domain" stopProcessing="true">
                    <match url=".*" />
                    <conditions>
                        <add input="{HTTP_HOST}" pattern="^https://mydomain.io$" />
                    </conditions>
                    <action type="Redirect" url="https://www.mydomain.io/{R:0}" redirectType="Permanent" />
                </rule>   

发生的情况是重定向没有发生,而是导航到根域 mydomain.io 下的 Azure 应用服务,导致“您的连接不安全”,因为根域未绑定到证书。

web.config 规则可能没有针对这种情况正确编写吗?

【问题讨论】:

  • 嗨@msestak 感谢您的建议和链接。我尝试修改 web.config 文件。查看更新后的问题。
  • 感谢@msestak 这有效。如果您愿意,可以将您的 cmets 复制到答案中。

标签: azure


【解决方案1】:

domain.io 不需要 SSL 证书。在 domain.io 应用服务上,您可以简单地配置 URL 重定向,例如 stackoverflow.com/a/18005525/1443361

将 domain.io 重定向到 https://mydomain.io 换行

<add input="{HTTP_HOST}" pattern="^domain.io$" />

【讨论】:

    猜你喜欢
    • 2020-08-28
    • 1970-01-01
    • 1970-01-01
    • 2014-03-25
    • 2015-05-19
    • 1970-01-01
    • 1970-01-01
    • 2019-02-07
    • 2013-11-07
    相关资源
    最近更新 更多