https (ssl) redirect code in php - PHP Views : 283
Tagged in : PHP
Send mail vote down 0 vote down 0
here is the code to be used in your page to redirect all http pages to https (secure connection - ssl)

<?
if($_SERVER['HTTPS']!="on")
{
$redirect= "https://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
header("Location:$redirect");
}

echo "testing https (ssl) redirection using php";
?>
By - rajesh, On - 2010-01-01




    Login to add Comments .