Hi All!
I'm trying to get a MediaWiki implementation running over here: http://aikiwiki.quay.net/ and everything seems to be OK, except for one problem. I've got mod_rewrite running on Apache (v1.3.27 -- I have to leave it at 1.3 for now due to unrelated problems with another app) and it seems to have no trouble rewriting (for example) http://aikiwiki.quay.net/wiki/Ueshiba_Morihei but as soon as I modify "$wgArticlePath" from "{$wgScript}?title=$1" to "/wiki/$1" I can no longer access any of the "Special" pages such as "http://aikiwiki.quay.net/w/wiki.phtml?title=Special:Preferences" instead the link goes to "http://aikiwiki.quay.net/wiki/Special:Preferences" and it's treated like an empty article.
I'm pretty sure that I just have something configured wrongly on my system, but I'm at a loss as to what it might be... any suggestions?
Here's the content of my "LocalSettings.php" file:
--- begin ---
<? # Local settings work like this: the file LocalSettings.sample # should be copied to LocalSettings.php in the source directory # and edited for your local file system settings and software # configuration preferences. The install script will copy it to # the installation path, but a copy should also remain in the # source tree so that maintenance scripts can refer to it (you # may want to make it a symbolic link after installation). Do # not check LocalSettings.php into CVS! It is different for # every installation, and must not be overridden.
# The most important setting is here: $IP is the installation # path for the software. #
$IP = "/my/path/to/mediawiki/w";
if ( ! isset( $DP ) ) { $DP = $IP; } include_once( "$DP/DefaultSettings.php" );
# You can customize a lot of URLs and paths, but you will # almost certainly want to customize the following. The # ArticlePath one is especially useful if you want to use # mod_redirect to make page-viewing URLs look static. # $wgSitename = "Aikiwiki"; $wgServer = "http://aikiwiki.quay.net"; #$wgArticlePath = "{$wgScript}?title=$1"; $wgArticlePath = "/wiki/$1"; $wgEmergencyContact = "aikiwiki@quay.net"; $wgLogo = "/images/aikiwiki.gif";
# MySQL settings # $wgDBserver = "localhost"; $wgDBuser = "user"; $wgDBname = "wiki"; $wgDBpassword = "somepass"; $wgDBsqlpassword = "anotherpass"; $wgDBminWordLen = 3; # Match this to your MySQL fulltext $wgDBtransactions = false; # Set to true if using InnoDB tables
# This code is still slightly experimental. Turn it off if "What links here" # and similar stuff does not work. $wgUseBetterLinksUpdate=true;
# Turn this on during database maintenance # $wgReadOnly = true;
# Turn this on to get HTML debug comments # $wgDebugComments = true;
# If you want a non-English wiki, add a line like this # $wgLanguageCode = "de";
$wgUseTeX = false;
$wgLocalInterwiki = "w";
$wgInputEncoding = "ISO-8859-1"; $wgOutputEncoding = "ISO-8859-1";
# Extremely high-traffic wikis may want to disable # some database-intensive features here: # # $wgDisableTextSearch = true; # $wgDisableCounters = true; # $wgMiserMode = true;
?>
--- end ---
Thanks for your help guys! Also an unrelated question, what is the difference between sysop and developer permissions?
cheers, Gabe
On Nov 11, 2003, at 09:57, Gabriel O'Brien wrote:
I'm trying to get a MediaWiki implementation running over here: http://aikiwiki.quay.net/ and everything seems to be OK, except for one problem. I've got mod_rewrite running on Apache (v1.3.27 -- I have to leave it at 1.3 for now due to unrelated problems with another app) and it seems to have no trouble rewriting (for example) http://aikiwiki.quay.net/wiki/Ueshiba_Morihei but as soon as I modify "$wgArticlePath" from "{$wgScript}?title=$1" to "/wiki/$1" I can no longer access any of the "Special" pages such as "http://aikiwiki.quay.net/w/wiki.phtml?title=Special:Preferences" instead the link goes to "http://aikiwiki.quay.net/wiki/Special:Preferences" and it's treated like an empty article.
That sounds pretty weird... Could you post the rewrite rules?
I notice it does the same thing for other pages w/ namespaces:
http://aiwiki.quay.net/w/wiki.phtml?title=Aikiwiki:Naming_Conventions http://aiwiki.quay.net/wiki/Aikiwiki:Naming_Conventions
which makes me suspicious it's something about the colon.
Thanks for your help guys! Also an unrelated question, what is the difference between sysop and developer permissions?
'Developer' used to have some special abilities like read/write SQL access through Special:Asksql. It's been decided that's just too dangerous to run over unencrypted HTTP, so it's been taken out. 'developer' now provides only:
Special:Debug -- runs phpinfo() Special:Lockdb -- set the global read-only lock Special:Unlockdb -- unset the global read-only lock
These can be done manually as well, so may eventually get phased out entirely.
-- brion vibber (brion @ pobox.com)
Brion Vibber wrote:
That sounds pretty weird... Could you post the rewrite rules?
I notice it does the same thing for other pages w/ namespaces:
http://aiwiki.quay.net/w/wiki.phtml?title=Aikiwiki:Naming_Conventions http://aiwiki.quay.net/wiki/Aikiwiki:Naming_Conventions
which makes me suspicious it's something about the colon.
Entirely possible, at best I'm a mod_rewrite novice! ;) Anyway here's the rewrite rules:
RewriteEngine On RewriteRule ^/wiki/(.*)$ /w/wiki.phtml?title=${$1} [L] RewriteRule ^/wiki$ /w/wiki.phtml
For what it's worth this is running within an Apache virutual host, but I don't think that should have any impact.
Any help you can provide would be awesome! ;)
cheers, Gabe
On Nov 11, 2003, at 18:42, Gabriel M. O'Brien wrote:
Brion Vibber wrote:
That sounds pretty weird... Could you post the rewrite rules? I notice it does the same thing for other pages w/ namespaces: http://aiwiki.quay.net/w/wiki.phtml?title=Aikiwiki:Naming_Conventions http://aiwiki.quay.net/wiki/Aikiwiki:Naming_Conventions which makes me suspicious it's something about the colon.
Entirely possible, at best I'm a mod_rewrite novice! ;) Anyway here's the rewrite rules:
RewriteEngine On RewriteRule ^/wiki/(.*)$ /w/wiki.phtml?title=${$1} [L]
Okay, if I use this line I see the same behavior on my text box (Apache 1.3.28 on Mac OS X 10.3). Try this:
RewriteRule ^/wiki/(.*)$ /w/wiki.phtml?title=$1 [L]
without the ${ and } around the $1, that should clear it up.
Investigating...
With the ${$1}, The translated query string ends up being something like "title=${Special:Recentchanges}". This seems to trip up the title canonicalization functions, which strip out illegal characters (such as $ and { and }) but seem to be doing so _after_ the check for a namespace prefix. So it's left with a title 'Special:Recentchanges' in the article namespace, which of course doesn't exist.
Thanks for digging up the title parser bug. :)
The extra ${...} would only get used if you were using a filter; for instance the default rewrite behavior will break title with ampersands, so if you patch your Apache sources with the 'ampescape.diff' patch you can use a filter than fixes it:
RewriteEngine On RewriteMap ampescape int:ampescape RewriteRule ^/wiki/(.*)$ /w/wiki.phtml?title=${ampescape:$1} [L]
-- brion vibber (brion @ pobox.com)
Brion Vibber wrote:
Okay, if I use this line I see the same behavior on my text box (Apache 1.3.28 on Mac OS X 10.3). Try this:
RewriteRule ^/wiki/(.*)$ /w/wiki.phtml?title=$1 [L]
without the ${ and } around the $1, that should clear it up.
That's the stuff! ;) It would appear that it fixes the problem on my system too! Thanks a bunch!
Thanks for digging up the title parser bug. :)
No, thank you! Once I internalize your answer maybe I'll update the MetaWiki page on mod_rewrite... ;)
Peace, Gabe
wikitech-l@lists.wikimedia.org