diff options
Diffstat (limited to 'engine/lib/configuration.php')
-rw-r--r-- | engine/lib/configuration.php | 23 |
1 files changed, 17 insertions, 6 deletions
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 |