From 25f9a20d2987257ac1d08f11d699f756e2d6fc03 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Fri, 12 Dec 2008 01:50:45 +0000 Subject: [PATCH] BUGFIX Making sure phpinstaller works on subdomains (see #3167) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@68515 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- main.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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(); }