From c40f843145a0081f5379c3b8f54cf00c683d1693 Mon Sep 17 00:00:00 2001 From: sminnee Date: Fri, 13 Mar 2009 00:20:02 +0000 Subject: [PATCH] BUGFIX: Fixed mod_rewrite-less operation in the root folder of a windows box git-svn-id: svn://svn.silverstripe.com/silverstripe/open/phpinstaller/branches/2.3@72995 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();