Skip to content

Commit

Permalink
Coalesce RewriteCond lines in .htaccess
Browse files Browse the repository at this point in the history
And escape some '.' where not yet escaped
  • Loading branch information
Sp1l committed Sep 6, 2020
1 parent 27fbab1 commit bfd6ea4
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions lib/private/Setup.php
Expand Up @@ -530,19 +530,12 @@ public static function updateHtaccess() {
$content .= "\n RewriteRule ^core/js/oc.js$ index.php [PT,E=PATH_INFO:$1]";
$content .= "\n RewriteRule ^core/preview.png$ index.php [PT,E=PATH_INFO:$1]";
$content .= "\n RewriteCond %{REQUEST_FILENAME} !\\.(css|js|svg|gif|png|html|ttf|woff2?|ico|jpg|jpeg|map|webm|mp4|mp3|ogg|wav)$";
$content .= "\n RewriteCond %{REQUEST_FILENAME} !core/img/favicon.ico$";
$content .= "\n RewriteCond %{REQUEST_FILENAME} !core/img/manifest.json$";
$content .= "\n RewriteCond %{REQUEST_FILENAME} !/remote.php";
$content .= "\n RewriteCond %{REQUEST_FILENAME} !/public.php";
$content .= "\n RewriteCond %{REQUEST_FILENAME} !/cron.php";
$content .= "\n RewriteCond %{REQUEST_FILENAME} !/core/ajax/update.php";
$content .= "\n RewriteCond %{REQUEST_FILENAME} !/status.php";
$content .= "\n RewriteCond %{REQUEST_FILENAME} !/ocs/v1.php";
$content .= "\n RewriteCond %{REQUEST_FILENAME} !/ocs/v2.php";
$content .= "\n RewriteCond %{REQUEST_FILENAME} !/robots.txt";
$content .= "\n RewriteCond %{REQUEST_FILENAME} !/updater/";
$content .= "\n RewriteCond %{REQUEST_FILENAME} !/ocs-provider/";
$content .= "\n RewriteCond %{REQUEST_FILENAME} !/ocm-provider/";
$content .= "\n RewriteCond %{REQUEST_FILENAME} !/core/ajax/update\\.php";
$content .= "\n RewriteCond %{REQUEST_FILENAME} !/core/img/(favicon\\.ico|manifest\\.json)$";
$content .= "\n RewriteCond %{REQUEST_FILENAME} !/(cron|public|remote|status)\\.php";
$content .= "\n RewriteCond %{REQUEST_FILENAME} !/ocs/v(1|2)\\.php";
$content .= "\n RewriteCond %{REQUEST_FILENAME} !/robots\\.txt";
$content .= "\n RewriteCond %{REQUEST_FILENAME} !/(ocm-provider|ocs-provider|updater)/";
$content .= "\n RewriteCond %{REQUEST_URI} !^/\\.well-known/(acme-challenge|pki-validation)/.*";
$content .= "\n RewriteCond %{REQUEST_FILENAME} !/richdocumentscode/proxy.php$";
$content .= "\n RewriteRule . index.php [PT,E=PATH_INFO:$1]";
Expand Down

0 comments on commit bfd6ea4

Please sign in to comment.