add short-url configuration
All checks were successful
Docker Build / Build and Push Images (push) Successful in 22s

This commit is contained in:
Seaswimmer 2024-08-08 11:38:44 -04:00
parent 46993bc36e
commit eaf3e25242
Signed by: cswimr
GPG key ID: 3813315477F26F82
2 changed files with 14 additions and 0 deletions

View file

@ -77,4 +77,6 @@ ENV COMPOSER_ALLOW_SUPERUSER=1
RUN composer update -d /var/www/html 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 RUN mkdir /var/log/mediawiki && chown www-data:www-data /var/log/mediawiki

12
mediawiki/short-url.conf Normal file
View file

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