diff --git a/lib/router.php b/lib/router.php index 4a2891d..710c41c 100644 --- a/lib/router.php +++ b/lib/router.php @@ -38,8 +38,14 @@ function initRouter(): bool if ($needsRedirect) { + if(!empty($routerRequest["subdomain"])){ + $sub_domain = $routerRequest["subdomain"] . "."; + } + else{ + $sub_domain = ""; + } $redirectAddress = $routerConfig["protocol"] . - $routerRequest["subdomain"] . "." . + $sub_domain . $routerRequest["domain"] . "." . $routerRequest["tld"] . "/" . $routerRequest["page_name"];