From 3bce1b20feb9525e7e2214c576f125077ffb112d Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Tue, 8 Dec 2015 08:10:55 +0100 Subject: Add DirectorySlash to dynamic .htaccess write When `DirectorySlash off` is set then Apache will not lookup folders anymore. This is required for example when we use the rewrite directives on an existing path such as `/core/search`. By default Apache would load `/core/search/` instead `/core/search` so the redirect would fail here. This leads however to the problem that URLs such as `localhost/owncloud` would not load anymore while `localhost/owncloud/` would. This has caused problems such as https://github.com/owncloud/core/pull/21015 With this change we add the `DirectorySlash off` directive only when the `.htaccess` is writable to the dynamic part of it. This would also make `localhost/owncloud` work again as it would trigger the 404 directive which triggers the redirect in base.php. --- lib/private/setup.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib') diff --git a/lib/private/setup.php b/lib/private/setup.php index 814d78679e2..869a87fbf13 100644 --- a/lib/private/setup.php +++ b/lib/private/setup.php @@ -439,6 +439,9 @@ class Setup { $content.="\n RewriteBase ".$webRoot; $content .= "\n "; $content .= "\n SetEnv front_controller_active true"; + $content .= "\n "; + $content .= "\n DirectorySlash off"; + $content .= "\n "; $content.="\n "; $content.="\n"; -- cgit v1.2.3