【问题标题】:WordPress site loads badly on HTTPS.WordPress 网站在 HTTPS 上加载很糟糕。
【发布时间】:2017-12-19 21:52:18
【问题描述】:

我有一个 WordPress 网站,但它在 HTTPS 上打开很糟糕。

如果有人使用 HTTPS 打开,我希望它重定向到 HTTP。

尝试将波纹管代码放入 .htaccess 文件中 -

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

但它破坏了网站,在多个部分给出错误 500。

我当前的 .htaccess 文件是 -

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

请帮助,任何帮助将不胜感激。

【问题讨论】:

  • 当你说它'打开不好'时,你是什么意思?如果您有 TLS 证书并且不想要 HTTPS,请删除该证书
  • 它打开但不加载任何东西。我想将https链接重定向到http,300重定向。
  • 顺便说一句,我正在使用 cloudflare。尚未安装任何 TLS 证书。

标签: php wordpress .htaccess https


【解决方案1】:

使用 Cloudflare,使用(在其他规则之前):

RewriteEngine on
RewriteCond %{HTTP:CF-Visitor} '"scheme":"https"'
RewriteRule ^ http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

或者您也可以添加 Clouflare 页面规则(Cloudflare 网站)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-09-13
    • 2012-05-08
    • 2016-05-14
    • 1970-01-01
    • 2018-01-20
    相关资源
    最近更新 更多