GoDawgs
25 May 2011, 09:22 PM
Hi, I have a page that goes on a loop when I try to use the following functions in Internet Explorer:
function redirectToHTTPS(){
if($_SERVER['HTTPS']!="on"){
if($_SERVER['HTTP_HOST'] == "www.peeka.com"){
$redirect= "https://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
}else{
$redirect= "https://www.".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
}
header("Location:$redirect");
}
}
function redirectToNonHTTPS(){
if($_SERVER['HTTPS']=="on"){
if($_SERVER['HTTP_HOST'] == "www.peeka.com"){
$redirect= "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
}else{
$redirect= "http://www.".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
}
}elseif($_SERVER['HTTP_HOST'] == "peeka.com"){
$redirect= "http://www.".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
}
header("Location:$redirect");
}
How do I get around this? Thanks.
function redirectToHTTPS(){
if($_SERVER['HTTPS']!="on"){
if($_SERVER['HTTP_HOST'] == "www.peeka.com"){
$redirect= "https://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
}else{
$redirect= "https://www.".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
}
header("Location:$redirect");
}
}
function redirectToNonHTTPS(){
if($_SERVER['HTTPS']=="on"){
if($_SERVER['HTTP_HOST'] == "www.peeka.com"){
$redirect= "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
}else{
$redirect= "http://www.".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
}
}elseif($_SERVER['HTTP_HOST'] == "peeka.com"){
$redirect= "http://www.".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
}
header("Location:$redirect");
}
How do I get around this? Thanks.