Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Find a solution to set mwWikiPath=/ (root, no /wiki/) - avoid double slash in URLs #2163

Closed
benoit74 opened this issue Feb 14, 2025 · 2 comments · Fixed by #2171
Closed

Find a solution to set mwWikiPath=/ (root, no /wiki/) - avoid double slash in URLs #2163

benoit74 opened this issue Feb 14, 2025 · 2 comments · Fixed by #2171
Assignees
Labels
Milestone

Comments

@benoit74
Copy link
Contributor

By default, mwWikiPath is /wiki/. On some wikis like appropedia, this wiki path is / (i.e. articles are served from the root). It is impossible to set mwWikiPath as / properly in 1.14.1

If we set mwWikiPath as /, then all computed URLs ends with a //, even if we remove any trailing slash in mwUrl. On some implementations, the // is automatically redirected and everything is more or else ok. But this is still not 100% correct.

The problem appears when we try to customize the Main article. Once Main Article is customized, mwoffliner is failing because of following error:

customMainPage doesn't return 200 status code for url https://www.appropedia.org//Welcome_to_Appropedia

See https://farm.openzim.org/pipeline/6bf63a96-91c2-4ea7-8cda-94021f96972a

Underlying cause is that mwoffliner does not support the 302 response sent at this URL. But root cause is that we should have a proper semantic / cleanup of input parameters which avoids to have double slash in all URLs but still allow to pass mwWikiPath as / (passing this parameter as empty string does not work because then Node consider the parameter is not set and use the default value for this parameter).

@Sophivorus
Copy link

Sophivorus commented Feb 18, 2025

Hi, sorry for the delay! I could modify our .htaccess so that https://www.appropedia.org//Welcome_to_Appropedia returns a 200 when it gets rewritten to https://www.appropedia.org/Welcome_to_Appropedia. However, I see you just sent a pull request that may solve the "root cause" of handling wikis with just / as their path, so there might be no need for it, but let me know if I can help in any way. Thanks again, cheers!

@benoit74
Copy link
Contributor Author

Yes, I want to solve the root cause because Appropedia wiki is not the only one in this situation, and it is a shame to be blocked by such a "simple" bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants