且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

导致htaccess重定向问题的旧https

更新时间:2023-10-21 17:34:22

无法使用.htaccess解决您的问题。如果您没有有效的https站点,则无法使用HTTP重写将HTTPS重定向到任何地方,因为客户端和服务器甚至需要开始使用HTTPS彼此对话,都需要SSL证书。
您应该为oldsite.com创建另一个虚拟主机来进行重定向(这些天您应该能够获得非常便宜甚至免费的SSL证书)。

There is no way to solve your problem using .htaccess. You can not use HTTP rewrite to redirect from HTTPS to anywhere if you don't have working https site, since SSL certificate is needed for client and server to even begin to talk to each other using HTTPS. You should create another virtual host for oldsite.com that will do the redirect (you should be able to get very cheap or even free SSL cert these days).

其他类似的答案:

如何在没有证书的情况下将HTTPS请求重定向到HTTP(Apache VirtualHosts)

如何在没有任何SSL证书的情况下将https重定向到http

https://serverfault.com/questions/429274/how-to-redirect-from-https-to-http-before-server-error