20100912

IE gives warning when redirect from HTTPS to HTTP

If you use header() method provided by PHP, to redirect from HTTPS to HTTP,
IE will give out a warning, but if you use the code below above othe PHP code, no warning will show.
// =========================================================
<?php                                                                                                                                                                                                     
if($_SERVER['HTTPS'] == "on") {
    $redirect = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
    echo "<meta http-equiv=\"refresh\" content=\"0; url=$redirect\">";
    exit();
}
?>
// ==========================================================
The tag "<meta>" will refresh the web page and jump/redirect to another web page.

--
from my gmail

没有评论:

发表评论