Our docs on how to setup shorturls have been horrible for awhile. They just about all suggest /index.php?title=$1 based rewrite rules. Despite the fact that MediaWiki has REQUEST_URI based handling code to extract titles from shorturls itself. The result is that a lot of these wiki have bugs with titles like [[C++]] and [[A&B]].
I'd like to get a bunch of wiki users running on different shared hosts and using these rewrite-rule based short urls. If I could get some people to spare some time, I can fix up the rewrite rules used for configuration to work in a more elegant and stable way, and we can test and see how these rules function on different shared hosts.
Naturally I have no interest in pre-1.11 installs (1.11 is when the REQUEST_URI stuff was introduced).
...one of these days I suppose I'm also going to have to sort out the absolutely horrible nginx instructions too. ((actually if anyone is using nginx, I'd be happy to sort out your config too))
Daniel Friesen wrote:
Our docs on how to setup shorturls have been horrible for awhile. They just about all suggest /index.php?title=$1 based rewrite rules. Despite the fact that MediaWiki has REQUEST_URI based handling code to extract titles from shorturls itself. The result is that a lot of these wiki have bugs with titles like [[C++]] and [[A&B]].
They work fine with QSA flag, which most servers should support by now. RewriteRule ^wiki/?(.*)$ /w/index.php?title=$1 [L,QSA]
On Fri, Aug 5, 2011 at 6:26 PM, Platonides Platonides@gmail.com wrote:
Daniel Friesen wrote:
Our docs on how to setup shorturls have been horrible for awhile. They just about all suggest /index.php?title=$1 based rewrite rules. Despite the fact that MediaWiki has REQUEST_URI based handling code to extract titles from shorturls itself. The result is that a lot of these wiki have bugs with titles like [[C++]] and [[A&B]].
They work fine with QSA flag, which most servers should support by now. RewriteRule ^wiki/?(.*)$ /w/index.php?title=$1 [L,QSA]
Presence of QSA or not doesn't seem to make a difference for me trying that rule on Apache/2.2.19 (Mac OS X 10.7 default install), no chance to check my Linux box until back in SF. :)
Is it possible that Apache finally changed mod_rewrite to assume that it's passing in individual strings and correctly escapes them?
Nope... it's actually that MediaWiki's manual processing of REQUEST_URI overwrites the raw query string processing.
$_GET for '/trunk/wiki/AT&T' translated to '/trunk/index.php?title=AT&T' still comes out as:
array(2) { ["title"]=> string(2) "AT" ["T"]=> string(0) "" }
:(
-- brion
mediawiki-l@lists.wikimedia.org