diff --git a/requires/Route.php b/requires/Route.php index 6e6f949..3d2f3f7 100644 --- a/requires/Route.php +++ b/requires/Route.php @@ -289,9 +289,14 @@ public static function generate_sitemap($cast_methods = ["GET"], $last_mod = "Y- $xml = new SimpleXMLElement(""); $xml->addAttribute("xmlns", "http://www.sitemaps.org/schemas/sitemap/0.9"); + // Get HTTP Protocol + $protocol = "http://"; + if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') { + $protocol = "https://"; + } + // Generating base path - $base = $protocol = strtolower(substr($_SERVER["SERVER_PROTOCOL"], 0, strpos($_SERVER["SERVER_PROTOCOL"], '/'))) . - '://' . $_SERVER["HTTP_HOST"]; + $base = $protocol . $_SERVER["HTTP_HOST"]; // Iterating over sites foreach (self::$routes as $route) {