dongzhuo1733 2017-01-06 16:15
浏览 44
已采纳

如何阻止随机重定向到HTTPS?

I'm facing a very annoying issue for a long time, perhaps someone could shed a light on this matter...

All my Wordpress websites at shared enrivonment at Hostinger all have the same bug: Random redirects to HTTPS

Sometimes it tries to load all resources through HTTPS - seems randomly.

Most of the time though, the redirect occurs on wp-admin, while saving posts, navigating, etc.

I already added this to .htaccess, for example:

RewriteCond %{HTTPS} on 
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI}

These are default wordpress installations with no settings changed, it's really a bug, Hostinger already acknolwedged that. They said they would fix it, but it's been more than 6 months.

The certificate is issued to *.main-hosting.eu and the error is NET::ERR_CERT_AUTHORITY_INVALID

How can I redirect ALL HTTPS requests to HTTP? How can I solve this bug?

-- Edit --

I confirmed it's a server-side bug, creating a simple debug.php with the following code: http://pastebin.com/n8PekA6d - the result is this: http://pastebin.com/t70nkTyj

  • 写回答

1条回答 默认 最新

  • doushu0591 2017-01-07 16:21
    关注

    I watched your video. Although I would normally recommend enabling https, in this case you might be off better with:

    $_SERVER['REQUEST_SCHEME'] = 'http';
    $_SERVER['SERVER_PORT'] = 80; //thanks to Lucas Bustamante
    

    in your wp-config.php. Hope that helps :)

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥15 stable diffusion
  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
  • ¥15 perl MISA分析p3_in脚本出错
  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿