diff --git a/advanced/index.php b/advanced/index.php index 911f3cc8..5e88a050 100644 --- a/advanced/index.php +++ b/advanced/index.php @@ -28,7 +28,7 @@ $authorizedHosts = []; // Append FQDN to $authorizedHosts if (!empty($svFQDN)) array_push($authorizedHosts, $svFQDN); - + // Append virtual hostname to $authorizedHosts if (!empty($_SERVER["VIRTUAL_HOST"])) { array_push($authorizedHosts, $_SERVER["VIRTUAL_HOST"]); @@ -40,6 +40,15 @@ $validExtTypes = array("asp", "htm", "html", "php", "rss", "xml", ""); // Get extension of current URL $currentUrlExt = pathinfo($_SERVER["REQUEST_URI"], PATHINFO_EXTENSION); +// Check if this is served over HTTP or HTTPS +if(isset($_SERVER['HTTPS'])) { + if ($_SERVER['HTTPS'] == "on") { + $proto = "https"; + } else { + $proto = "http"; + } +} + // Set mobile friendly viewport $viewPort = ''; @@ -60,7 +69,7 @@ if ($serverName === "pi.hole") {