PHP https 更改 http
1 if ($_SERVER['REQUEST_SCHEME'] == 'https') { 2 $newUrl = 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; 3 Header("HTTP/1.1 301 Moved Permanently"); 4 header("Location: $newUrl"); 5 exit; 6 }
1 if ($_SERVER['REQUEST_SCHEME'] == 'https') { 2 $newUrl = 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; 3 Header("HTTP/1.1 301 Moved Permanently"); 4 header("Location: $newUrl"); 5 exit; 6 }