aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2016-03-09 15:13:07 +0100
committerLukas Reschke <lukas@owncloud.com>2016-03-09 15:13:07 +0100
commitbc4a043a7645efe207e3f1208ac3dea41b056384 (patch)
tree42d851abb5ad7405b9c5dab8691b7f5d1f71bd8e
parenteff17fd3b7021019e387e4f48a38ec450f622649 (diff)
downloadnextcloud-server-bc4a043a7645efe207e3f1208ac3dea41b056384.tar.gz
nextcloud-server-bc4a043a7645efe207e3f1208ac3dea41b056384.zip
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.
-rw-r--r--.htaccess1
-rw-r--r--lib/private/setup.php5
2 files changed, 3 insertions, 3 deletions
diff --git a/.htaccess b/.htaccess
index ec33fe31e15..085467e91ca 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]
</IfModule>
<IfModule mod_mime.c>
AddType image/svg+xml svg svgz
diff --git a/lib/private/setup.php b/lib/private/setup.php
index b9f8828227e..8a10a9cfbec 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<IfModule mod_rewrite.c>";
- $content.="\n RewriteBase ".$webRoot;
+ $content .= "\n<IfModule mod_rewrite.c>";
+ $content .= "\n RewriteRule .* index.php [PT,E=PATH_INFO:$1]";
+ $content .= "\n RewriteBase ".$webRoot;
$content .= "\n <IfModule mod_env.c>";
$content .= "\n SetEnv front_controller_active true";
$content .= "\n <IfModule mod_dir.c>";