summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2016-04-26 13:18:18 +0200
committerVincent Petry <pvince81@owncloud.com>2016-04-26 20:13:20 +0200
commit7ee7d091f2bb1d0271507782bf193b232f9199c3 (patch)
treef50f61fcb29973affcb0e4761461896c7de540a4 /lib
parent1087385cae70ce59dd100f330fae5a640ed08025 (diff)
downloadnextcloud-server-7ee7d091f2bb1d0271507782bf193b232f9199c3.tar.gz
nextcloud-server-7ee7d091f2bb1d0271507782bf193b232f9199c3.zip
Don't write empty RewriteBase
ownCloud may be configured to live at the root folder without a trailing slash being specified. In this case manually set the rewrite base to `/`
Diffstat (limited to 'lib')
-rw-r--r--lib/private/setup.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/private/setup.php b/lib/private/setup.php
index d2f3802ebad..196ae8a8bce 100644
--- a/lib/private/setup.php
+++ b/lib/private/setup.php
@@ -427,10 +427,18 @@ class Setup {
//custom 404 error page
$content.= "\nErrorDocument 404 ".$webRoot."/core/templates/404.php";
+ // ownCloud may be configured to live at the root folder without a
+ // trailing slash being specified. In this case manually set the
+ // rewrite base to `/`
+ $rewriteBase = $webRoot;
+ if($webRoot === '') {
+ $rewriteBase = '/';
+ }
+
// Add rewrite base
$content .= "\n<IfModule mod_rewrite.c>";
$content .= "\n RewriteRule . index.php [PT,E=PATH_INFO:$1]";
- $content .= "\n RewriteBase ".$webRoot;
+ $content .= "\n RewriteBase ".$rewriteBase;
$content .= "\n <IfModule mod_env.c>";
$content .= "\n SetEnv front_controller_active true";
$content .= "\n <IfModule mod_dir.c>";