dongzhuo1733
dongzhuo1733
2017-01-06 16:15

如何阻止随机重定向到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 doushu0591 4年前

    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 :)

    点赞 评论 复制链接分享