From eaf3e25242a2a512b5474b0821588166961ba073 Mon Sep 17 00:00:00 2001 From: Seaswimmer Date: Thu, 8 Aug 2024 11:38:44 -0400 Subject: [PATCH] add short-url configuration --- mediawiki/Dockerfile | 2 ++ mediawiki/short-url.conf | 12 ++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 mediawiki/short-url.conf diff --git a/mediawiki/Dockerfile b/mediawiki/Dockerfile index bbd37d1..90abd4e 100644 --- a/mediawiki/Dockerfile +++ b/mediawiki/Dockerfile @@ -77,4 +77,6 @@ ENV COMPOSER_ALLOW_SUPERUSER=1 RUN composer update -d /var/www/html +COPY short-url.conf /etc/apache2/conf-enabled/short-url.conf + RUN mkdir /var/log/mediawiki && chown www-data:www-data /var/log/mediawiki diff --git a/mediawiki/short-url.conf b/mediawiki/short-url.conf new file mode 100644 index 0000000..fc2714b --- /dev/null +++ b/mediawiki/short-url.conf @@ -0,0 +1,12 @@ +RewriteEngine On +RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f +RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d +RewriteRule ^(.*)$ %{DOCUMENT_ROOT}/index.php [L] + +RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f +RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d +RewriteRule ^/?images/thumb/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$ %{DOCUMENT_ROOT}/thumb.php?f=$1&width=$2 [L,QSA,B] + +RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f +RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d +RewriteRule ^/?images/thumb/archive/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$ %{DOCUMENT_ROOT}/thumb.php?f=$1&width=$2&archived=1 [L,QSA,B]