[英]Redirect from https://example.com to https://www.example.com without a valid certificate on example.com
i want to redirect all traffic to https://www.sitename.com 我想将所有流量重定向到https://www.sitename.com
example 例
http://sitename.com --> https://www.sitename.com http://sitename.com - > https://www.sitename.com
http://www.sitename.com --> https://www.sitename.com http://www.sitename.com - > https://www.sitename.com
https://sitename.com --> https://www.sitename.com https://sitename.com - > https://www.sitename.com
i am using these rules 我正在使用这些规则
<rule name="Redirect non-www OR non-https to https://www">
<match url=".*" />
<conditions logicalGrouping="MatchAny">
<add input="{HTTP_HOST}" pattern="^sitename.com$" />
<add input="{HTTPS}" pattern="off" />
</conditions>
<action type="Redirect" url="https://www.sitename.com/{R:0}" redirectType="Permanent"/>
</rule>
these work fine but only https://sitename.com gives certificate error and does not redirect properly 这些工作正常,但只有https://sitename.com提供证书错误,并没有正确重定向
https://sitename.com --> https://www.sitename.com https://sitename.com - > https://www.sitename.com
this does not work ? 这不起作用?
i have set same certificate for both https and https://www . 我为https和https:// www设置了相同的证书。
i get a Error code: SSL_ERROR_BAD_CERT_DOMAIN for http://sitename.com which is understood 我得到一个错误代码: http ://sitename.com的SSL_ERROR_BAD_CERT_DOMAIN,这是理解的
is there any way i could redirect before the SSL handshake is made ? 有没有什么方法可以在SSL握手之前重定向?
is there any way i could redirect before the SSL handshake is made ?
有没有什么方法可以在SSL握手之前重定向?
No. If the browser can't establish a secure connection, a redirect can't be made (Except an HSTS redirect http to https in some cases) 否。如果浏览器无法建立安全连接,则无法进行重定向(在某些情况下,HSTS将http重定向为https除外)
You need to get a certificate for sitename.com too if you want to make it work (you can have one certificate valid for the two domains) 如果你想使它工作,你需要获得sitename.com的证书(你可以有一个证书对两个域有效)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.