php一句代码让http跳转https
//其他框架请加到入口某共公加载的文件中 //方法一 https状态 if(!isset($_SERVER[‘HTTPS‘]) || $_SERVER[‘HTTPS‘] == ‘off‘){ Header("HTTP/1.1 301 Moved Permanently"); header(‘Location: https://‘.$_SERVER[‘HTTP_HOST‘].$_SERVER[‘REQUEST_URI‘]); } //方法二 判断端口 if($_SERVER[‘SERVER_PORT‘]=="80"){ Header("HTTP/1.1 301 Moved Permanently"); header(‘Location: https://‘.$_SERVER[‘HTTP_HOST‘].$_SERVER[‘REQUEST_URI‘]); }
相关推荐
JF0 2020-01-31
kentrl 2020-11-10
咻咻ing 2020-07-04
wghou 2020-06-16
zkwgpp 2020-06-14
xiechao000 2020-05-18
woniyu 2020-05-14
ysmh00 2020-05-14
0与的世界 2020-04-28
worldkun 2020-05-10
carolAnn 2020-04-20
zengni 2020-02-29
hygbuaa 2020-02-26
zhaolisha 2020-02-24
server { listen 80; server_name ××××.com; access_log /×××/×××/nginx/log/access.log; error_log /×××/×
咻咻ing 2020-02-02
OwenJi 2020-01-17
webfullStack 2020-01-10
houjinkai 2020-01-01