Merge pull request #3780 from ip1981/master

Fixed rewrite rules for Mediawiki
This commit is contained in:
Rickard Nilsson 2014-08-25 12:46:08 +02:00
commit 684e8b241e
2 changed files with 4 additions and 0 deletions

View file

@ -34,6 +34,9 @@ rec {
concatStringsSep = separator: list:
concatStrings (intersperse separator list);
concatMapStringsSep = sep: f: list: concatStringsSep sep (map f list);
concatImapStringsSep = sep: f: list: concatStringsSep sep (lib.imap f list);
# Construct a Unix-style search path consisting of each `subDir"
# directory of the given list of packages. For example,

View file

@ -133,6 +133,7 @@ in
RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
${concatMapStringsSep "\n" (u: "RewriteCond %{REQUEST_URI} !^${u.urlPath}") serverInfo.serverConfig.servedDirs}
RewriteRule ${if config.enableUploads
then "!^/images"
else "^.*\$"