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']);
}
發佈了80 篇原創文章 · 獲贊 13 · 訪問量 8萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章