http HTTPS PHP

php怎么把http改为https

九三
699
2021-03-03 14:35:12
栏目: 编程语言

php怎么把http改为https

使用php将http转化为https的方法

//http转化为https

if ($_SERVER["HTTPS"]<>"on")

{

$xredir="https://".$_SERVER["SERVER_NAME"].

$_SERVER["REQUEST_URI"];

header("Location: ".$xredir);

}

?>

0
看了该问题的人还看了