As I have previously mentioned, we run a MediaWiki based wiki within my research group. As a purely aesthetic function I chose to use a pretty URL. This essentially means the URL I use to access the wiki is shorter,
www.domain.com/wiki/Chemistryinstead of:
www.domain.com/wiki/index.php/ChemistryIt turns out it is quite fiddly to get the setup sorted, but the end result is definitely preferable.
N.B. These instructions only work when using domain.com/wiki/Chemistry. If you use wiki.domain.com/Chemistry that is more tricky and domain.com/Chemistry is not recommended, see here for info on those scenarios. In addition, I assume you have root access to your webserver, you are using MediaWiki 1.9.x or later and an apache webserver.
In this example I assume your DocumentRoot for html files is /srv/htdocs. Move your unpackaged mediawiki files to /srv/htdocs/w. We will use apache to make wiki valid.
Edit your httpd.conf, to enable /srv/htdocs to read .htaccess files. Alter AllowOverride None to AllowOverride FileInfo.
Now create the file to read /srv/htdocs/.htaccess, with the contents:
RewriteEngine OnNext tell your mediawiki configuration about this change by adding/editing /srv/htdocs/w/LocalSettings.php with:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Make the wiki appear to come from wiki/
RewriteRule ^wiki/?(.*)$ /w/index.php?title=$1 [L,QSA]
$wgScriptPath = "/w";Now when you access domain.com/wiki/Chemistry, Apache will actually request domain.com/w/index.php?title=Chemistry. Although you will not see this in the address bar unless you edit a page. If you edit a page but it wants to edit a page called Index.php, something has gone wrong!
$wgArticlePath = "/wiki/$1";
Do check here for other information, perhaps the details there are sufficiently up to date to get this work - they were not when I originally tried.
There is one restriction with this method - articles names must not include a question mark (ampersands, &, are fine).