|
|||||||
other links |
ViewsMediaWiki SEF URLsFrom WikiOut of the box MediaWiki URLs will look like this (assuming that your wiki is installed on http://www.yourdomain.com/wiki):
To accomplish this, do the following: 1) Install MediaWiki in a directory other than the intended URL path. 1) Modify the Script Path used by MediaWiki 2) Modify .htaccess to rewrite URLs.
[edit] Install MediaWiki in a directory other than the intended URL pathWhile there are solutions that do not require this step, it is easier if your MediaWiki is installed in a different directory.
[edit] Script PathThen you have to modify the Article Path that MediaWiki uses to generate URLs.
$wgScriptPath = '/w'; $wgArticlePath = '/wiki/$1';
[edit] Modify .htaccess to rewrite URLsThen you have to tell your server to forward all /wiki/* requests to MediaWiki's script. There are many variants out there. The one included here is what we use at nuHIT.com. To do this append the following to the .htaccess file found in your site's root (or create a new .htaccess if none exists)
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^wiki/?(.*)$ /w/index.php?title=$1 [L,QSA]
Notice that the .htaccess method only works for Apache Servers with the mod_rewrite handler installed. If you are using IIS, there is a URL rewrite ISAPI filter that can accomplish the same results.
[edit] External Siteshttp://meta.wikimedia.org/wiki/Eliminating_index.php_from_the_url http://www.mediawiki.org/wiki/Manual:Short_URL http://meta.wikimedia.org/wiki/Using_a_very_short_URL |