summaryrefslogtreecommitdiffstats
path: root/.htaccess
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2016-05-12 09:43:26 +0200
committerThomas Müller <DeepDiver1975@users.noreply.github.com>2016-05-12 09:43:26 +0200
commit52add798d4d814b5276e324c2e98404ff0abe020 (patch)
tree55af97e8245ba7584ae626d8f258697b9d99d049 /.htaccess
parentdd9ee10bc0699e5dcc17c3ef2181dcda01d9a69b (diff)
downloadnextcloud-server-52add798d4d814b5276e324c2e98404ff0abe020.tar.gz
nextcloud-server-52add798d4d814b5276e324c2e98404ff0abe020.zip
Do not automatically try to enable index.php-less URLs (#24539)
The current logic for mod_rewrite relies on the fact that people have properly configured ownCloud, basically it reads from the `overwrite.cli.ur l` entry and then derives the `RewriteBase` from it. This usually works. However, since the ownCloud packages seem to install themselves at `/owncloud` (because subfolders are cool or so…) _a lot_ of people have just created a new Virtual Host for it or have simply symlinked the path etc. This means that `overwrite.cli.url` is wrong, which fails hard if it is used as RewriteBase since Apache does not know where it should serve files from. In the end the ownCloud instance will not be accessible anymore and users will be frustrated. Also some shared hosters like 1&1 (because using shared hosters is so awesome… ;-)) have somewhat dubious Apache configurations or use versions of mod_rewrite from the mediveal age. (because updating is money or so…) Anyhow. This makes this explicitly an opt-in configuration flag. If `htaccess.RewriteBase` is set then it will configure index.php-less URLs, if admins set that after installation and don't want to wait until the next ownCloud version they can run `occ maintenance:update:htaccess`. For ownCloud 9.0 we also have to add a repair step to make sure that instances that already have a RewriteBase configured continue to use it by copying it into the config file. That way all existing URLs stay valid. That one is not in this PR since this is unneccessary in master. Effectively this reduces another risk of breakage when updating from ownCloud 8 to ownCloud 9. Fixes https://github.com/owncloud/core/issues/24525, https://github.com/owncloud/core/issues/24426 and probably some more.
Diffstat (limited to '.htaccess')
-rw-r--r--.htaccess17
1 files changed, 0 insertions, 17 deletions
diff --git a/.htaccess b/.htaccess
index df074f7f806..5bf7b321f0c 100644
--- a/.htaccess
+++ b/.htaccess
@@ -59,23 +59,6 @@
RewriteRule ^(build|tests|config|lib|3rdparty|templates)/.* - [R=404,L]
RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge/.*
RewriteRule ^(\.|autotest|occ|issue|indie|db_|console).* - [R=404,L]
-
- # Rewrite rules for `front_controller_active`
- Options -MultiViews
- RewriteRule ^core/js/oc.js$ index.php [PT,E=PATH_INFO:$1]
- RewriteRule ^core/preview.png$ index.php [PT,E=PATH_INFO:$1]
- RewriteCond %{REQUEST_FILENAME} !\.(css|js|svg|gif|png|html|ttf|woff|ico|jpg|jpeg)$
- RewriteCond %{REQUEST_FILENAME} !core/img/favicon.ico$
- RewriteCond %{REQUEST_FILENAME} !/remote.php
- RewriteCond %{REQUEST_FILENAME} !/public.php
- RewriteCond %{REQUEST_FILENAME} !/cron.php
- RewriteCond %{REQUEST_FILENAME} !/core/ajax/update.php
- RewriteCond %{REQUEST_FILENAME} !/status.php
- RewriteCond %{REQUEST_FILENAME} !/ocs/v1.php
- RewriteCond %{REQUEST_FILENAME} !/ocs/v2.php
- RewriteCond %{REQUEST_FILENAME} !/updater/
- RewriteCond %{REQUEST_FILENAME} !/ocs-provider/
- RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge/.*
</IfModule>
<IfModule mod_mime.c>
AddType image/svg+xml svg svgz