From bc4a043a7645efe207e3f1208ac3dea41b056384 Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Wed, 9 Mar 2016 15:13:07 +0100 Subject: [PATCH] Add base rewrite rule only when RewriteBase is defined In case Apache is configured with an `Alias` such as with the ownCloud packages the rewrite rules will fail when no valid RewriteBase is configured. --- .htaccess | 1 - lib/private/setup.php | 5 +++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.htaccess b/.htaccess index ec33fe31e1..085467e91c 100644 --- a/.htaccess +++ b/.htaccess @@ -65,7 +65,6 @@ RewriteCond %{REQUEST_FILENAME} !/updater/ RewriteCond %{REQUEST_FILENAME} !/ocs-provider/ RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge/.* - RewriteRule .* index.php [PT,E=PATH_INFO:$1] AddType image/svg+xml svg svgz diff --git a/lib/private/setup.php b/lib/private/setup.php index b9f8828227..8a10a9cfbe 100644 --- a/lib/private/setup.php +++ b/lib/private/setup.php @@ -422,8 +422,9 @@ class Setup { // Add rewrite base $webRoot = !empty(\OC::$WEBROOT) ? \OC::$WEBROOT : '/'; - $content.="\n"; - $content.="\n RewriteBase ".$webRoot; + $content .= "\n"; + $content .= "\n RewriteRule .* index.php [PT,E=PATH_INFO:$1]"; + $content .= "\n RewriteBase ".$webRoot; $content .= "\n "; $content .= "\n SetEnv front_controller_active true"; $content .= "\n ";