最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Admin sometimes redirects to HTTPS

programmeradmin0浏览0评论

I have multiple Wordpress installations hosted at Hostinger.

Sometimes, when I save a post or, as happened right now, just tried to access wp-admin, it redirects me to HTTPS version of the website.

It happens randomly with all my websites, I just type in the address again and it works normally.

It's a strange bug, my settings are set to HTTP, I don't know much else to say. Anyone got any ideas to debug this?

Thanks a lot!

I have multiple Wordpress installations hosted at Hostinger.

Sometimes, when I save a post or, as happened right now, just tried to access wp-admin, it redirects me to HTTPS version of the website.

It happens randomly with all my websites, I just type in the address again and it works normally.

It's a strange bug, my settings are set to HTTP, I don't know much else to say. Anyone got any ideas to debug this?

Thanks a lot!

Share Improve this question asked Jun 23, 2016 at 14:36 Lucas BustamanteLucas Bustamante 2,3481 gold badge28 silver badges43 bronze badges 4
  • Do you have "HTTPS Everywhere" or similar in your browser? – InanisAtheos Commented Dec 15, 2016 at 14:54
  • No, I tried it on my phone (3G), my sister's computer, my laptop and my PC - all gave the same error, even in fresh websites I tested in Hostinger - it's server side – Lucas Bustamante Commented Dec 15, 2016 at 19:06
  • Yes it does seem like a server-side error. – InanisAtheos Commented Dec 16, 2016 at 7:24
  • I’m just going to say it: “Add https to your site!!! It’s easy. Visit letsencrypt.” If your host doesn’t offer https for free, do it yourself! – Nathan Powell Commented May 31, 2018 at 5:29
Add a comment  | 

1 Answer 1

Reset to default 1

Finally, after MONTHS I was able to solve it.

Just add

$_SERVER['REQUEST_SCHEME'] = 'http';
$_SERVER['SERVER_PORT'] = 80;

To wp-config.php, preferably before calling wp-settings.php

Thanks to Daan Meijer for this.

PS: It was a server-side error, probably something to do with PHP process manager such as php-fpm or mod_php. The hosting company solved it without the need for the hack above.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论