diff --git a/bl-kernel/boot/init.php b/bl-kernel/boot/init.php index c66877f6..3411e3f1 100644 --- a/bl-kernel/boot/init.php +++ b/bl-kernel/boot/init.php @@ -209,12 +209,16 @@ elseif( empty($base) ) { $base = dirname($base); } -if($base!=DS) { +// Assume URLs are rewritten to server root if current URL doesn't start with $base +if (strpos($_SERVER['REQUEST_URI'], $base) !== 0) { + $base = '/'; +} + +if($base!=DS and strlen($base > 0)) { $base = trim($base, '/'); $base = '/'.$base.'/'; } else { - // Workaround for Windows Web Servers $base = '/'; } diff --git a/install.php b/install.php index ba5453cc..ed893f3f 100644 --- a/install.php +++ b/install.php @@ -84,12 +84,16 @@ elseif( empty($base) ) { $base = dirname($base); } -if($base!=DS) { +// Assume URLs are rewritten to server root if current URL doesn't start with $base +if (strpos($_SERVER['REQUEST_URI'], $base) !== 0) { + $base = '/'; +} + +if($base!=DS and strlen($base > 0)) { $base = trim($base, '/'); $base = '/'.$base.'/'; } else { - // Workaround for Windows Web Servers $base = '/'; }