Random HTTPs redirections at admin area in shared hosting
While editing or writing a new post, sometimes I get redirected to the following address: https://www.examplesite.com/wp-login.php?redirect_to=https://www.examplesite.com/wp-admin/edit.phpreauth=1
Even though i wasn't navigating using https. We don't have an SSL certificate for our domain, so we get the following warning message: "There is a problem with this website’s security certificate."
I have around 30 wordpress websites hosted on Hostinger, and all of them gives this issue.
Any idea what causes it? I've seen a temporary solution might be adding
$_SERVER['HTTP_HOST'] = $_SERVER['SERVER_NAME'];
To wp-config.php, but I'm looking for a permanent solution, and the root of the problem...