您好,欢迎访问一九零五行业门户网

判断是否为 HTTPS 并跳转

在php运行开始时,检验是否位https链接,若不是则跳转
switch (true) {    case (!isset($_server['https'])) :    case ($_server['https']!=on)   :        redirecttohttps();        break;}
复制代码
function redirecttohttps(){    $redirect= https://.$_server['http_host'].$_server['request_uri'];    header(location:$redirect);    exit;}
复制代码
其它类似信息

推荐信息