【问题标题】:Redirection with ssl not working all times使用 ssl 的重定向并非一直有效
【发布时间】:2023-03-27 12:15:02
【问题描述】:

我正在尝试重定向许多请求:

http://www.site.example -> https://site.example
http://site.example -> https://site.example
https://www.site.example -> https://site.example

只有最后一个,不行,返回SSL_ERROR_NO_CYPHER_OVERLAP

我测试了很多条件和规则,这是主要的:

RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]

RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

附加:

在新的 Google Search Console 中仍然需要添加所有版本(http、https、www、非 www)并选择首选?

【问题讨论】:

    标签: .htaccess ssl redirect


    【解决方案1】:

    只有最后一个,我不工作,返回 SSL_ERROR_NO_CYPHER_OVERLAP

    这与重定向无关,因此您的配置没有帮助。相反,这意味着您尝试访问的域没有或没有正确配置 HTTPS,即www.site.example。普通 HTTP 仍然可能适用于该域,但 HTTPS 不会,并且错误发生在服务器甚至可以发送重定向之前。

    【讨论】:

    • @Lucius0101:是的
    猜你喜欢
    • 2013-08-15
    • 1970-01-01
    • 2012-01-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-12-30
    • 1970-01-01
    • 2015-03-20
    相关资源
    最近更新 更多