From b615415b26cb1560439b779eee1a6a9428929bed Mon Sep 17 00:00:00 2001 From: icewing Date: Mon, 3 Mar 2008 16:35:52 +0000 Subject: Fixed wwwroot git-svn-id: https://code.elgg.org/elgg/trunk@62 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/configuration.php | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'engine/lib/configuration.php') diff --git a/engine/lib/configuration.php b/engine/lib/configuration.php index dfbc95279..6b2bfbb49 100644 --- a/engine/lib/configuration.php +++ b/engine/lib/configuration.php @@ -33,12 +33,23 @@ if (empty($CONFIG->wwwroot)) { $CONFIG->wwwroot = "http://" . $_SERVER['SERVER_NAME']; - if (strripos($_SERVER['DOCUMENT_ROOT'],"/") < (sizeof($_SERVER['DOCUMENT_ROOT']) - 1)) { + /*if (strripos($_SERVER['DOCUMENT_ROOT'],"/") < (strlen($_SERVER['DOCUMENT_ROOT']) - 1)) { $CONFIG->wwwroot .= "/"; - } - $CONFIG->wwwroot .= str_replace($_SERVER['DOCUMENT_ROOT'],"",$CONFIG->path); + }*/ + + $request = $_SERVER['REQUEST_URI']; + + if (strripos($request,"/") < (strlen($request) - 1)) { + // addressing a file directly, not a dir + $request = substr($request, 0, strripos($request,"/")+1); + } + + $CONFIG->wwwroot .= $request; + + //$CONFIG->wwwroot .= str_replace($_SERVER['DOCUMENT_ROOT'],"",$CONFIG->path); + } - + if (empty($CONFIG->url)) $CONFIG->url = $CONFIG->wwwroot; @@ -46,8 +57,8 @@ $CONFIG->sitename = "New Elgg site"; if (empty($CONFIG->debug)) - $CONFIG->debug = false; - + $CONFIG->debug = false; + } ?> \ No newline at end of file -- cgit v1.2.3