final public static function redirectToRoute(
        string $routename,
        array $params = array(),
        bool $domain = true,
        array $query = array(),
        int $status = 302
    ):void {

        $querystring = $domainstring = "";
        $route = self::generateRoute($routename, $params);
        if (!empty($query)) {
            foreach ($query as $one => $value) {
                $querystring .= "$one=$value".(((end($query) !== $value))? "&": "");
            }
            $querystring = "?$querystring";
        }

        if (true === $domain) {
            $server = new GlobalServer();
            $https = ((null !== $server->get("HTTPS") &&
                "on" === $server->get("HTTPS"))? "https://" : "http://");
            $domain = $https.$server->get("HTTP_HOST");
        }
        header("Location: $domain$route$querystring", $status);
        exit(1);
    }