新HTTPS跳转方式

新https跳转方法,更快,无需设置伪静态,只需把代码加入header.php就可以,代码如下

<?php
 if ($_SERVER["HTTPS"] <> "on")
{
    $xredir = "https://".$_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
    header("Location: ".$xredir);
}
?>
Last modification:April 4th, 2019 at 10:25 pm
If you think my article is useful to you, please feel free to appreciate

Leave a Comment