BUGFIX: fixed double slash when installed in the root. PATCH via simon_w. #4733 (from r98038)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/phpinstaller/trunk@112093 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
sminnee 2010-10-13 02:33:55 +00:00
parent bf5e862c6a
commit e76df36179

View File

@ -54,7 +54,7 @@ $fileName = dirname($_SERVER['SCRIPT_FILENAME']) . '/' . $url;
* Very quickly pass through references to files
*/
if($url && file_exists($fileName)) {
$fileURL = dirname($_SERVER['SCRIPT_NAME']) . '/' . $url;
$fileURL = (dirname($_SERVER['SCRIPT_NAME'])=='/'?'':dirname($_SERVER['SCRIPT_NAME'])) . '/' . $url;
header($_SERVER['SERVER_PROTOCOL'] . ' 301 Moved Permanently');
header("Location: $fileURL");
die();