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:
[quote="guice, post:5, topic:28446"]
Here's a fun trick I like to use:
ln -s wiki_media/index.php ./wiki
Put in my .htaccess file:
AddHandler dh-php /cgi-system/php5.cgi
Then point your Wiki configs to use www.domain.com/wiki as the URL and tell it to use "pretty" URLs. It'll start using: www.domain.com/wiki/Start_Page, etc.
Feel free to play with it however you please. It's a nice way to pretty up the URLs w/out relying on RewriteRule which can slow down the server.
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/
LocalSettings.php has the standard:
$wgScriptPath = "/w";
$wgArticlePath = "/wiki/$1";