【发布时间】:2016-05-04 01:45:43
【问题描述】:
之前我已将我的默认 Wordpress 安装设置为 http:// 并在 Cloudflare 中将其重定向以使用 Https SSL,但在浏览器上出现了几个 混合内容错误 [说明 https 请求是http]。
所以,全新安装了我的整个 wordpress 以使用 https:// 但我在没有安装 SSL 证书的共享服务器上,所以现在我的整个站点重定向到 https:// 并显示 [未找到服务器错误]。
我只需要将我的 wordpress 保存在 https:// 中,以便使用站点地图和其他插件来仅访问 https:// 而不会发生冲突。
- 那么,我是否需要将 .htaccess 文件中的所有 https:// 重定向到 http://,然后将 http:// 重定向到 cloudflare 以使用 https://,并作为我的默认安装的 Wordpress 为 https://
-
在 .htaccess 中使用了几个规则但无济于事,请告诉我将所有 http:// 重定向到 https:// 的确切规则
RewriteCond %{SERVER_PORT} ^443$ 重写规则 ^(.*)$ http://%{HTTP_HOST}/$1 [R=301,L]
RewriteCond %{HTTPS} on RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] #RewriteEngine On RewriteCond %{SERVER_PORT} 443 RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
【问题讨论】:
标签: php wordpress .htaccess redirect ssl