mediawiki rewrite rules only needed with no urlPrefix

This commit is contained in:
Shea Levy 2014-02-27 06:37:22 -05:00
parent c23ec33c77
commit 1e7300ad67

View File

@ -126,7 +126,17 @@ in
</Directory>
''}
${optionalString (config.urlPrefix != "") "Alias ${config.urlPrefix} ${mediawikiRoot}"}
${if config.urlPrefix != "" then "Alias ${config.urlPrefix} ${mediawikiRoot}" else ''
RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
RewriteRule ^(.*)$ %{DOCUMENT_ROOT}/${if config.articleUrlPrefix == ""
then ""
else "${config.articleUrlPrefix}/"
}index.php [L]
RewriteRule ^/*$ ${mediawikiRoot}/index.php [L] # For syntax hilighter: */
''}
<Directory ${mediawikiRoot}>
Order allow,deny
@ -137,13 +147,6 @@ in
${optionalString (config.articleUrlPrefix != "") ''
Alias ${config.articleUrlPrefix} ${mediawikiRoot}/index.php
''}
RewriteEngine On
RewriteCond ${mediawikiRoot}/$0 !-f
RewriteCond ${mediawikiRoot}/$0 !-d
RewriteRule ^(.*)$ ${mediawikiRoot}/index.php [L]
RewriteRule ^/*$ ${mediawikiRoot}/index.php [L] # For syntax hilighter: */
'';
documentRoot = if config.urlPrefix == "" then mediawikiRoot else null;