Description
Before moving to Moin 1.5.1, I had created pages whose name were finishing by a question mark. I cannot access these pages anymore (except by renaming the page in the Data directory).
When trying to access these pages, I end-up in a page without the final quotation mark (and space). In the suggested list of page, I see the correct page name, but clicking on it, I get back to the same point.
How do you try to access these pages? Typing the ? in the url will not works because it is treated as the query separator. To make sure it does not work, try to add a link to such page in your wiki, using ["page name and ?"], then try the link.
Contents
Steps to reproduce
- Create a page.
Rename it to "Test ?" -- rename by wiki action "RenamePage"? or in the filesytem?
Not reproducible in this wiki as you described above.
Note that you never rename pages in the file system directly, unless you know what you are doing!
Example
Details
MoinMoin Version |
1.5.1 |
OS and Version |
Debian Stable |
Python Version |
2.3.5 |
Server Setup |
Twisted |
Server Details |
|
Workaround
Rename the page in the Data directory to a name without question mark. or:
Modify request.py in MoinMoin-1.5.7: modrewrite.diff
Discussion
Works for me. Can you reproduce it in this wiki?
Such name should work with no problem when you create it /another test page?, but it may be impossible for users to type such name in the browser, since they must escape the ? to %3F. Generally it is questionable name for a page
I also had strange "Pagename ending with a ?" behaviour recently. In my case it was a broken mod_rewrite, not correctly processing %3F, but just throwing it away. In my case, this was not a bug we can fix in moin, but a mod_rewrite bug (and yes, an open bug exists for it in apache bugzilla). It is strange though that you have seen such a bug with Twisted server as we use Twisted here, too, and it works. So maybe upgrading to a more recent Twisted version maybe helps.
As long as it can be reproduced in the main wiki, it is a bug that should be filed here. Why do you think that Twisted is the problem here? It had been working and you didn't change Twisted in the mean time. -- AlexanderSchremmer
It does not happen here. -- ThomasWaldmann 2006-03-07 09:33:12
I had the same problem, and googling a bit around I found this bug thread from the Xaraya CMS. Apparently the problem is with a feature from Apache... but it doesn't seem to have much of a solution, especially if you (like me) can only edit a .htaccess file and not the httpd.conf (which many hosting venues don't allow you to do).
I could easily avoid using question marks in my wiki names... the problem is that there are pages shipped in the default underlay with them in place, like WikiCourse/BasicIntroduction/000 What is a Wiki?, WikiCourse/BasicIntroduction/060 How do I navigate?, CursoWiki/IntroducciónBásica/000 Qué es un Wiki? and CursoWiki/IntroducciónBásica/060 Cómo navego?. I think the pages ending in "?" should be renamed (in MoinMaster?) and pages linking to them corrected in order to avoid compatibility problems when using mod_rewrite. -- MarianoAbsatz 2006-08-16 21:33:55
It does not make sense to rename perfectly valid pages because someone don't know how to use mod_rewrite. It makes sense only if the problem is very common and hard to avoid. If its rare, documenting the problem is enough. -- NirSoffer
- Can you give an example about how to use mod_rewrite without breaking those pages?
I do not think that it is possible. -- AlexanderSchremmer 2006-08-17 09:52:59
I second the renaming. It simply does not make sense to have the basic docs. broken in a plain moin installation under Apache by default for such an irrelevant detail as a trailing question mark. In the meantime maybe the bug with mod rewrite will be corrected or somebody will find a workaround. As it stands currently it harms the reputation of Moin Moin. Or should Moin Moin advise not to use Apache? -- AlvaroTejero 2006-08-21 11:35:28
- Can you give an example about how to use mod_rewrite without breaking those pages?
On-line examples of this problem at:
http://wiki.apache.org/spamassassin/WikiCourse/BasicIntroduction/000_What_is_a_Wiki%3F
http://wiki.winehq.org/WikiCourse/BasicIntroduction/000_What_is_a_Wiki%3F
http://gauss.ffii.org/CursoWiki/Introducci%C3%B3nB%C3%A1sica/000_Qu%C3%A9_es_un_Wiki%3F
http://wiki.apache.org/jakarta/WikiCourse/BasicIntroduction/060_How_do_I_navigate%3f
-- MarianoAbsatz 2006-08-16 21:33:55
Looks like those wikis use broken web server configuration. Moin parse the url that ends with %3f correctly, but if the web server breaks it before moin see it, nothing can be done
I agree with you... this is probably an Apache or mod_rewrite bug... however, given that Apache 1.3 / 2.0 configured via .htaccess is a very common only choice in low-cost hosting, it'd be nice if someone knowledgable in Apache configuration would give a good sample .htaccess that supports page names ending in '?'.
-- MarianoAbsatz 2007-02-22 15:58:51
MediaWiki correctly detects this and works around it... maybe Moin should too?
-- Anonymous 2007-05-03 17:01:00
root versus non-root wiki
My moin 1.5.3 site has the question mark problem since I made the site a root modpy wiki according to the instructions on this site. Moving back to the non-root cgi version by reversing the apache 1.3.34 config file solved the problem, because a %3f in the url is treated differently from a question mark. Maybe this is another hint at an apache bug, but also a fix; cgi works just fine.
- This wiki run now on FastCGI and it works correctly (try the test page above). It may be apache configuration issue or mod python issue.
I can reproduce it on a 1.5.6 wiki running on Apache 2.0.52 with a rewrite rule defined in .htaccess file and the server. I don't have access to the rewrite rules in the server.
My rewrite rules are:
RewriteEngine On RewriteRule ^wiki(/.*)?$ /index.cgi$1 [type=application/x-httpd-cgi]
Reproduce:
- Install the .htaccess file
Add link to Foo? or visit /Foo%3F
- The url shows "/Foo%3F"
- Moin see "Foo"
Printing env in _setup_vars_from_std_env show this:
SERVER_SOFTWARE = Apache/2.0.52 (Red Hat) DAV/2 SVN/1.3.2 mod_ssl/2.0.52 OpenSSL/0.9.7a PHP/5.2.1 mod_fastcgi/2.4.2 SCRIPT_NAME = /index.cgi PATH_INFO = /Foo REDIRECT_URL = /wiki/Foo? SERVER_PROTOCOL = HTTP/1.1 QUERY_STRING = SCRIPT_URI = http://example.com/wiki/Foo? SCRIPT_URL = /wiki/Foo? REQUEST_URI = /wiki/Foo%3F
So it is probably not moin error but it can be fixed in moin by poking into one of the variables added by Apache, that contain the missing question mark.
There is already a makeURI method, but it create the uri from script_name and path_info, which does not help.
Rewrite rules to fix this
It's even more unusual to find a ? in the middle of a page name than at the end. So try something like this:
RewriteEngine on RewriteRule ^wiki(.*)$ - [last] RewriteRule ^$ cgi-bin/moin.cgi [last] RewriteRule !^cgi-bin/moin.cgi.* - [chain] RewriteRule ^(.*)\?$ cgi-bin/moin.cgi/$1\%3f [last] RewriteRule !^cgi-bin/moin.cgi.* - [chain] RewriteRule ^(.*)$ cgi-bin/moin.cgi/$1 [last]
That is, notice a trailing ? and put it back in. If you do have ?s in the middle, you could match those in the same way, taking (.*)\?(.*) to $1\%3f$2. But that seems very unlikely to me. Similarly, you could handle a second mark in that way.
Adapting these rules to my .htaccess worked OK in http://moin.semap.baby.com.ar/CursoWiki/Introducci%C3%B3nB%C3%A1sica/000%20Qu%C3%A9%20es%20un%20Wiki%3F . Thanx "c-24-128-49-213" for sharing it. -- MarianoAbsatz 2008-03-03 14:19:39
Plan
Needs testing on various Apache setups.
- Priority: Medium
- Assigned to:
- Status: Reproducible on 1.5.6 with apache and mod_rewrite, bug is located in mod_rewrite