在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;}
复制代码
