您的位置:宽带测速网 > 网络安全 > php怎么把http改为https

php怎么把http改为https

2025-06-24 17:08来源:互联网 [ ]

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

//http转化为https

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

{

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

$_SERVER["REQUEST_URI"];

header("Location: ".$xredir);

}

?>