I have MediaWiki installed on DreamHost’s shared-hosting environment, and I’m currently using mod_rewrite with the following lines in .htaccess, as the MediaWiki manual instructs:
RewriteRule ^/?wiki/(.*)$ /w/index.php?title=$1 [PT,L,QSA]
RewriteRule ^/?wiki/*$ /w/index.php [L,QSA]
RewriteRule ^/*$ /w/index.php [L,QSA]
I find this to be causing a noticeable hit on speed, likely due to the inherent inefficiency in rewriting. Searching around, I stumbled upon a 2006 post by a user named guice providing an alternative:
I tried what he recommended but wasn’t sure exactly which settings are involved in ‘point your Wiki configs to use www.domain.com/wiki as the URL and tell it to use “pretty” URLs’, and in the end, this method just gave me 404s.
Seeing as I can’t PM or email users on this forum, I can’t get in touch with guice personally, so I’m wondering if anyone here might know what needs to be done to get guice’s more efficient method working.
Curiously, nowhere else on the Web but an even vaguer Chinese site even mentions this method.
My MediaWiki’s installation environment:
MediaWiki installed to /w [yes, I did replace the “wiki_media” in guice’s shell command with “w”]
Hope to use URL format /wiki/<page_name>
LocalSettings.php has the standard:
$wgScriptPath = "/w";
$wgArticlePath = "/wiki/$1";