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 }
原文:https://www.cnblogs.com/aqufush/p/13176404.html