if($_SERVER['HTTP_HOST']=='80zx.com'){ header("HTTP/1.1 301 Moved Permanently"); function isHTTPS() { if (defined('HTTPS') && HTTPS) return true; if (!isset($_SERVER)) return FALSE; if (!isset($_SERVER['HTTPS'])) return FALSE; if ($_SERVER['HTTPS'] === 1) { //Apache return TRUE; } elseif ($_SERVER['HTTPS'] === 'on') { //IIS return TRUE; } elseif ($_SERVER['SERVER_PORT'] == 443) { //其他 return TRUE; } return FALSE; } $protocol=isHTTPS() ? 'https://' : 'http://'; $cur_url = $protocol . 'www.80zx.com' . $_SERVER['REQUEST_URI']; Header("Location:{$cur_url}"); }
如果本文对你有帮助,欢迎打赏本站