Enable rewrite in Mediawiki
To those who want to enable rewrite in Mediawiki, please take a look at the following instructions:
- Move your Wiki to a sub directory of your site, for instance /w
- Create .htaccess in root directory, that is / and add the following lines to it:
- Open your LocalSettings.php and add the following lines to it:
- Done.
RewriteEngine on
RewriteRule ^wiki/?(.*)$ /w/index.php?title=$1 [L,QSA]
$wgScriptPath = "/w";
$wgScript = "/wiki";
$wgArticlePath = "$wgScript/$1";
Before you try this, please make sure you have enabled the rewrite feature of your Apache. and what the most important is: when you enabled rewrite in httpd.conf, you must stop it and start it. please note, if you just try 'restart', it won't work. i was stuck here for a loooog time. ![]()