[bitnami/mediawiki] 404 errors when overriding MEDIAWIKI_WIKI_PREFIX
Name and Version
bitnami/mediawiki:1
What architecture are you using?
amd64
What steps will reproduce the bug?
set a non-default value for the prefix in the docker compose environment:
- MEDIAWIKI_WIKI_PREFIX=/something
then run docker compose up
What is the expected behavior?
MediaWiki is accessible at /something instead of /wiki
What do you see instead?
Every page under /something returns a 404 error:
mediawiki-1 | mediawiki 22:25:41.93 INFO ==> Running MediaWiki install script
mediawiki-1 | mediawiki 22:25:43.06 INFO ==> Configuring MediaWiki settings
mediawiki-1 | mediawiki 22:25:43.07 INFO ==> Setting MediaWiki short URLs
mediawiki-1 | mediawiki 22:25:43.08 INFO ==> Persisting MediaWiki installation
mediawiki-1 | mediawiki 22:25:44.95 INFO ==> ** MediaWiki setup finished! **
mediawiki-1 |
mediawiki-1 | mediawiki 22:25:44.95 INFO ==> ** Starting Apache **
mediawiki-1 | [Sat Mar 23 22:25:45.180354 2024] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.58 (Unix) OpenSSL/3.0.11 configured -- resuming normal operations
mediawiki-1 | [Sat Mar 23 22:25:45.180392 2024] [core:notice] [pid 1] AH00094: Command line: '/opt/bitnami/apache/bin/httpd -f /opt/bitnami/apache/conf/httpd.conf -D FOREGROUND'
mediawiki-1 | 192.168.160.1 - - [23/Mar/2024:22:26:06 +0000] "GET / HTTP/1.1" 301 -
mediawiki-1 | 192.168.160.1 - - [23/Mar/2024:22:26:07 +0000] "GET /something/Main_Page HTTP/1.1" 404 196
mediawiki-1 | 192.168.160.1 - - [23/Mar/2024:22:26:07 +0000] "GET /favicon.ico HTTP/1.1" 404 196
Additional information
No response
afaict the RewriteRule needs to match the prefix, instead of being hardcoded to /wiki: https://github.com/bitnami/containers/blob/main/bitnami/mediawiki/1/debian-12/rootfs/opt/bitnami/scripts/mediawiki/postunpack.sh#L50
But since postunpack.sh is run during the image build, it can't be overridden with environment variables.
Thank you for opening this issue and submitting the associated Pull Request. Our team will review and provide feedback. Once the PR is merged, the issue will automatically close.
Your contribution is greatly appreciated!
This Issue has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thanks for the feedback.
un-stale
Due to the lack of activity in the last 5 days since it was marked as "stale", we proceed to close this Issue. Do not hesitate to reopen it later if necessary.
>:(
This Issue has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thanks for the feedback.
Due to the lack of activity in the last 5 days since it was marked as "stale", we proceed to close this Issue. Do not hesitate to reopen it later if necessary.
Hi seems I face a very similar issue.
I tried to run mediawiki 1.41.1 under kubernetes with env variables MEDIAWIKI_HOST, MEDIAWIKI_WIKI_PREFIX and I'm redirected without any domain when I reach the /
But If I enter a full URL like https://wiki-mydomain.com/index.php/Main_Page it's displayed. But if I click on any link, I will face a redirection without my domain name again
EDIT: For who face this issue seems @dunn is currently working on PR #64098. Thanks a lot ☜(゚ヮ゚☜)
Hi,
Do you know when docker image will be available on hub with this fix ? Thanks
Hi @Ducatel,
The latest version of the bitnami/mediawiki image now includes the fix (1.41.1-debian-12-r8).
Ok So still not working for me. let's open a dedicated one
Hi
As I just mentioned in the PR, these changes are breaking the functionality of the container, you get several redirect loops when you try to access the app or work with it. This is preventing our test to pass and update the Chart solution.
We are planing some changes to make the solution work again and they will be included in the next release:
- Recover the old logic to configure the $wgServer parameter in the conf file
- The $wgCanonicalServer parameter uses that configuration by default according to the official documentation: https://www.mediawiki.org/wiki/Manual:$wgCanonicalServer
- RewriteRules will be updated to use the ones mentioned in the official documentation https://www.mediawiki.org/wiki/Manual:Short_URL/wiki/Page_Title_--_.htaccess
If you continue running into issues when running the app behind a proxy, please do create another PR to update the configuration taking these changes into account.
Changes were applied here: https://github.com/bitnami/containers/pull/67621
Thanks for letting me know, I'll take a look.