得劲

php实现强制跳转https
话不多说上代码: <?php if ($_SERVER["HTTPS"] <> "on") {...
扫描右侧二维码阅读全文
13
2018/10

php实现强制跳转https

话不多说上代码:

<?php
 if ($_SERVER["HTTPS"] <> "on")
{
    $xredir = "https://".$_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
    header("Location: ".$xredir);
}
?>

直接把以上代码丢网站头部即可!

Last modification:October 13th, 2018 at 01:48 pm
If you think my article is useful to you, please feel free to appreciate

Leave a Comment