summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-12-02 10:56:44 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2015-12-02 10:56:44 +0100
commit812a390f32a60746ba36c6cb28088aa47fed3b66 (patch)
tree7cb23552d2501280867eae908368fc8ae56f33f1
parent438d0be844d212dcc5dbf3933ced46de0bdce486 (diff)
parent65b4d97a2aabbb9d1ecb68b0d0021b7af0b99659 (diff)
downloadnextcloud-server-812a390f32a60746ba36c6cb28088aa47fed3b66.tar.gz
nextcloud-server-812a390f32a60746ba36c6cb28088aa47fed3b66.zip
Merge pull request #20879 from owncloud/check-if-rewrite-base-is-set-if-rewrite-is-active
Check if rewrite base is set if rewrite is active
-rw-r--r--.htaccess28
-rw-r--r--lib/private/setup.php6
-rw-r--r--version.php2
3 files changed, 21 insertions, 15 deletions
diff --git a/.htaccess b/.htaccess
index 5c11eff9f37..4f2a6f35af4 100644
--- a/.htaccess
+++ b/.htaccess
@@ -44,20 +44,22 @@
RewriteRule ^(build|tests|config|lib|3rdparty|templates)/.* - [R=404,L]
RewriteRule ^(\.|autotest|occ|issue|indie|db_|console).* - [R=404,L]
- <IfModule mod_env.c>
- SetEnv front_controller_active true
- 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)$
- RewriteCond %{REQUEST_FILENAME} !/remote.php
- RewriteCond %{REQUEST_FILENAME} !/public.php
- RewriteCond %{REQUEST_FILENAME} !/cron.php
- RewriteCond %{REQUEST_FILENAME} !/status.php
- RewriteCond %{REQUEST_FILENAME} !/ocs/v1.php
- RewriteCond %{REQUEST_FILENAME} !/ocs/v2.php
- RewriteRule .* index.php [PT,E=PATH_INFO:$1]
+ # Rewrite rules for `front_controller_active`
+ Options -MultiViews
+ <IfModule mod_dir.c>
+ DirectorySlash off
</IfModule>
-
+ RewriteRule ^core/js/oc.js$ index.php/core/js/oc.js [PT,E=PATH_INFO:$1]
+ RewriteRule ^core/preview.png$ index.php/core/preview.png [PT,E=PATH_INFO:$1]
+ RewriteCond %{REQUEST_FILENAME} !\.(css|js|svg|gif|png|html|ttf|woff)$
+ 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
+ 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 1f91240e9da..2c959622cc7 100644
--- a/lib/private/setup.php
+++ b/lib/private/setup.php
@@ -434,8 +434,12 @@ class Setup {
}
// Add rewrite base
+ $webRoot = !empty(\OC::$WEBROOT) ? \OC::$WEBROOT : '/';
$content.="\n<IfModule mod_rewrite.c>";
- $content.="\n RewriteBase ".\OC::$WEBROOT;
+ $content.="\n RewriteBase ".$webRoot;
+ $content .= "\n <IfModule mod_env.c>";
+ $content .= "\n SetEnv front_controller_active true";
+ $content.="\n </IfModule>";
$content.="\n</IfModule>";
if ($content !== '') {
diff --git a/version.php b/version.php
index 68ed5c9c217..ca90fdb3167 100644
--- a/version.php
+++ b/version.php
@@ -25,7 +25,7 @@
// We only can count up. The 4. digit is only for the internal patchlevel to trigger DB upgrades
// between betas, final and RCs. This is _not_ the public version number. Reset minor/patchlevel
// when updating major/minor version number.
-$OC_Version = array(9, 0, 0, 4);
+$OC_Version = array(9, 0, 0, 5);
// The human readable string
$OC_VersionString = '9.0 pre alpha';