diff --git a/main.php b/main.php index 555537462..743eff331 100644 --- a/main.php +++ b/main.php @@ -95,7 +95,8 @@ require_once("core/model/DB.php"); // Redirect to the installer if no database is selected if(!isset($databaseConfig) || !isset($databaseConfig['database']) || !$databaseConfig['database']) { - $installURL = dirname(dirname($_SERVER['SCRIPT_NAME'])) . '/install.php'; + $s = (isset($_SERVER['SSL']) || (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off')) ? 's' : ''; + $installURL = "http$s://" . $_SERVER['HTTP_HOST'] . dirname(dirname($_SERVER['SCRIPT_NAME'])) . '/install.php'; header("Location: $installURL"); die(); }