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 `/`
This commit is contained in:
Lukas Reschke 2016-04-26 13:18:18 +02:00 committed by Vincent Petry
parent 1087385cae
commit 7ee7d091f2
No known key found for this signature in database
GPG Key ID: AF8F9EFC56562186
1 changed files with 9 additions and 1 deletions

View File

@ -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>";