Browse Source

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.
tags/v9.1.0beta1
Lukas Reschke 8 years ago
parent
commit
bc4a043a76
2 changed files with 3 additions and 3 deletions
  1. 0
    1
      .htaccess
  2. 3
    2
      lib/private/setup.php

+ 0
- 1
.htaccess View File

@@ -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

+ 3
- 2
lib/private/setup.php View File

@@ -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>";

Loading…
Cancel
Save