我在 Microsoft Azure 上托管一个网站,需要添加从旧域 (domain1.com) 到新域 (www.domain2.com) 的重定向。然而,我遇到的问题是重定向在不安全的网址上工作正常:
但是它不能在安全网址上正常工作:
发生的情况是我收到证书警告,即给定的证书对此域无效。如果我接受警告,重定向到新域就可以了。
这表明一切工作正常,只是在浏览器中发生重定向之前协商了 ssl,并且因为第一个域上没有 ssl 证书,所以我收到警告。它是否正确?
我在这里缺少什么吗?有一个更好的方法吗?我是否需要两个域的 ssl 证书?
这是我的 web.config 文件,以便您可以看到我的配置:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<!-- Don't show directory listings for URLs which map to a directory. -->
<directoryBrowse enabled="false" />
<rewrite>
<rules>
<rule name="Protect files and directories from prying eyes" stopProcessing="true">
<match url="\.(engine|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)$|^(\..*|Entries.*|Repository|Root|Tag|Template)$" />
<action type="CustomResponse" statusCode="403" subStatusCode="0" statusReason="Forbidden" statusDescription="Access is forbidden." />
</rule>
<rule name="Force simple …Run Code Online (Sandbox Code Playgroud)