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
This commit is contained in:
Thomas Müller 2015-12-02 10:56:44 +01:00
commit 812a390f32
3 changed files with 21 additions and 15 deletions

View File

@ -44,20 +44,22 @@
RewriteRule ^(build|tests|config|lib|3rdparty|templates)/.* - [R=404,L] RewriteRule ^(build|tests|config|lib|3rdparty|templates)/.* - [R=404,L]
RewriteRule ^(\.|autotest|occ|issue|indie|db_|console).* - [R=404,L] RewriteRule ^(\.|autotest|occ|issue|indie|db_|console).* - [R=404,L]
<IfModule mod_env.c> # Rewrite rules for `front_controller_active`
SetEnv front_controller_active true Options -MultiViews
RewriteRule ^core/js/oc.js$ index.php [PT,E=PATH_INFO:$1] <IfModule mod_dir.c>
RewriteRule ^core/preview.png$ index.php [PT,E=PATH_INFO:$1] DirectorySlash off
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]
</IfModule> </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>
<IfModule mod_mime.c> <IfModule mod_mime.c>
AddType image/svg+xml svg svgz AddType image/svg+xml svg svgz

View File

@ -434,8 +434,12 @@ class Setup {
} }
// Add rewrite base // Add rewrite base
$webRoot = !empty(\OC::$WEBROOT) ? \OC::$WEBROOT : '/';
$content.="\n<IfModule mod_rewrite.c>"; $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>"; $content.="\n</IfModule>";
if ($content !== '') { if ($content !== '') {

View File

@ -25,7 +25,7 @@
// We only can count up. The 4. digit is only for the internal patchlevel to trigger DB upgrades // 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 // between betas, final and RCs. This is _not_ the public version number. Reset minor/patchlevel
// when updating major/minor version number. // when updating major/minor version number.
$OC_Version = array(9, 0, 0, 4); $OC_Version = array(9, 0, 0, 5);
// The human readable string // The human readable string
$OC_VersionString = '9.0 pre alpha'; $OC_VersionString = '9.0 pre alpha';