This commit is contained in:
Bruno Rybársky 2024-01-11 09:56:09 +01:00
parent e897de442b
commit 29e4cf7be6

@ -12,6 +12,8 @@ $page_dir = "pages/";
$dynamic_page_dir = "dynamic/";
$subdomain = basename(explode('.', $_SERVER['HTTP_HOST'])[0]);
$domain = basename(explode('.', $_SERVER['HTTP_HOST'])[1]);
$tld = basename(explode('.', $_SERVER['HTTP_HOST'])[2]);
$page_name = basename($_SERVER["QUERY_STRING"]);;
@ -20,7 +22,7 @@ $srvname = $_SERVER["SERVER_NAME"];
$protocol = $_SERVER['PROTOCOL'] = isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && !empty($_SERVER['HTTP_X_FORWARDED_PROTO']) ? "https://" : "http://";
if (empty($page_name)){
header("Location: $protocol$srvname/$default_page");
header("Location: $protocol$domain.$tld/$default_page");
return;
}