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.

Steps to reproduce

  1. Create a page.
  2. 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

/TestPage?

/TestPage ?

Details

MoinMoin Version

1.5.1

OS and Version

Debian Stable

Python Version

2.3.5

Server Setup

Twisted

Server Details

Workaround

  1. Rename the page in the Data directory to a name without question mark. or:

  2. 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 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

On-line examples of this problem at:

-- MarianoAbsatz 2006-08-16 21:33:55

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.

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:

  1. Install the .htaccess file
  2. Add link to Foo? or visit /Foo%3F

  3. The url shows "/Foo%3F"
  4. 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.

Plan

Needs testing on various Apache setups.


CategoryMoinMoinNoBug

MoinMoin: MoinMoinBugs/CannotAccessPagesEndingWithAQuestionMark (last edited 2008-03-03 14:19:39 by MarianoAbsatz)