I was setting up a small wiki site to track my music collection and track details and was trying to set up short urls like “http://wiki.myhost.org/Main_Page” instead of “http://wiki.myhost.org/index.php?title=Main_Page”
From all the reading up I did on various forums and wiki’s I was preparing for a long night ahead of me to get this working. However it turned out be a anti-climax with the URL’s working after only a couple of trials. Here’s how I did it.
Installed mediawiki using the oneClick install on wiki.myhost.org and then changed
this ->
$wgArticlePath = "$wgScript?title=$1";
->to this
$wgArticlePath = "/$1";
and then created a file .htaccess at ~/wiki.myhost.org/.htaccess and added the following lines in it
Options FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ /index.php?title=$1 [L,QSA]
I’m not sure at this point how completely it works, as I have just started experimenting with it. It sure rendered the Main_page and all the pages linked to the Main_page correctly, including Search. So am happy for now. Will report back if I run into issues. If I don’t, assume I’m doing just fine.
Thanks for the help guys.
Leave a Reply