PHP: Redirect HTTP to HTTPS
[code language=”php”] if((!(isset($_SERVER[‘HTTPS’]))) || ($_SERVER[‘HTTPS’] == "") || ($_SERVER[‘HTTPS’] == "off")) header("Location: https://" . $_SERVER[‘HTTP_HOST’] . $_SERVER[‘PHP_SELF’]); [/code]
[code language=”php”] if((!(isset($_SERVER[‘HTTPS’]))) || ($_SERVER[‘HTTPS’] == "") || ($_SERVER[‘HTTPS’] == "off")) header("Location: https://" . $_SERVER[‘HTTP_HOST’] . $_SERVER[‘PHP_SELF’]); [/code]