I would really like to use the answer from the following question: How can I force users to access my page over HTTPS instead of HTTP?
BUT I was always under the impression that the global $_SERVER
variable is vulnerable to change by the users, and should not be relied on. Is that true?
if($_SERVER["HTTPS"] != "on")
{
header("Location: https://" . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]);
exit();
}
If it is vulnerable to change, why did so many people recommend this answer.