http - 启用 SSL 和 http 重定向时出现错误的请求错误
问题描述
我配置并启用了 SSL,一切正常。但是在启用从 http 到 https 的重定向后,打开网站时出现以下错误:
Bad Request
Your browser sent a request that this server could not understand.
Reason: You’re speaking plain HTTP to an SSL-enabled server port.
Instead use the HTTPS scheme to access this URL, please.
我注意到这仅在通过mywebsite.com
在浏览器搜索栏上键入访问该站点时发生,当我访问它时,URL 显示如下:http://mywebsite.com:443/
如果我删除 :443 部分,它可以正常工作并重定向到 https。
我怎样才能使它在从浏览器访问时不会转到错误的 url?目前,我已禁用重定向以避免我的客户试图返回该站点并收到该错误。
更新:
这是我使用的配置:
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [R,L]
在这里找到:https ://docs.bitnami.com/bch/apps/wordpress/administration/force-https-apache/
解决方案
推荐阅读
- c# - 如何按名称中包含空格的表列进行搜索?
- oracle - 如何在独立(战争)和嵌入式 Tomcat 中为 Spring-Boot 应用程序配置数据源?
- jenkins - 无法从 jenkins 下载 maven 依赖项
- android - 清单合并失败,出现多个错误
- node.js - 通过nodejs查询mongodb显示空结果?
- css - 为什么日文字符在 CSS 宽度动画上表现不同?
- c# - 如何翻译应用程序名称取决于 xamarin 形式的移动文化?
- postgresql - pgr_drivingDistance 在每条路线上具有灵活的距离值
- asp.net-mvc-5 - ExpressiveAnnotations.Attributes 必需如果验证不起作用
- c# - 订单字符串包含数字(Linq,C#)