新HTTPS跳转方式

新https跳转方法,更快,无需设置伪静态,只需把代码加入header.php就可以,代码如下
<?php
if ($_SERVER[“HTTPS”] <> “on”)
{
$xredir = “https://“.$SERVER[“SERVER

NAME”].$_SERVER[“REQUEST_URI”];
header(“Location: “.$xredir);
}
?>

Author

Linus Xiong

Posted on

2018-04-10

Updated on

2019-04-04

Licensed under

Comments