From 92db28eaaeedc8875009ede6fd4c755336d0aed9 Mon Sep 17 00:00:00 2001 From: ischommer Date: Thu, 19 Nov 2009 19:41:12 +0000 Subject: [PATCH] BUGFIX: Fixed mod_rewrite-less operation in the root folder of a windows box (from r72995) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/phpinstaller/trunk@92243 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- index.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/index.php b/index.php index acf4188..48c369a 100644 --- a/index.php +++ b/index.php @@ -32,7 +32,9 @@ if($ruLen > $snLen && substr($_SERVER['REQUEST_URI'],0,$snLen+1) == ($_SERVER['S * Very quickly pass through references to files */ if(file_exists($fileName)) { - $fileURL = dirname($_SERVER['SCRIPT_NAME']) . '/' . $url; + $baseURL = dirname($_SERVER['SCRIPT_NAME']); + if($baseURL == "\\" || $baseURL == "/") $baseURL = ""; + $fileURL = "$baseURL/$url"; header($_SERVER['SERVER_PROTOCOL'] . ' 301 Moved Permanently'); header("Location: $fileURL"); die();