summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Müller <DeepDiver1975@users.noreply.github.com>2016-04-26 14:35:53 +0200
committerThomas Müller <DeepDiver1975@users.noreply.github.com>2016-04-26 14:35:53 +0200
commite5dbeb24ea0d267e831e75898a74ca396c037c72 (patch)
tree782d83c0230682ca0212920318a09bc19498e3d0
parent7d86136670a922e1f63d85b75c47b8b72454a76d (diff)
parentdf8b851f538a5571e21ca2bf7e3ad7464f3a01c5 (diff)
downloadnextcloud-server-e5dbeb24ea0d267e831e75898a74ca396c037c72.tar.gz
nextcloud-server-e5dbeb24ea0d267e831e75898a74ca396c037c72.zip
Merge pull request #24277 from owncloud/more-sanity
Don't write empty RewriteBase
-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>";