
Untitled
By: a guest on
May 7th, 2012 | syntax:
None | size: 0.44 KB | hits: 12 | expires: Never
Trouble redirecting to HTTPS with PHP
if (!isset($_SERVER['HTTPS']) || !$_SERVER['HTTPS']) {
$url = 'https://www.mysite.php';
header("location: ". $url);
exit();
}
if (!isset($_SERVER['HTTPS']) OR !$_SERVER['HTTPS']) {
if (!isset($_SERVER['HTTPS']) AND !$_SERVER['HTTPS']) {
if(empty($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != "on") {
header("Location: https://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
}