php 强制跳转到https

if(!isset($_SERVER['HTTPS'])||$_SERVER['HTTPS']=='off'){
    header("HTTP/1.1 301 Moved Permanently");
    header('Location:https://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
}

posted on 2022-09-09 11:07  小馬過河﹎  阅读(113)  评论(0)    收藏  举报

导航