By PhDs, (© Copyright reserved),
August 26, 2007 at 7:01 am
· Category: MediaWiKi
There are many articles on various web sites talking about shortening URL for mediawiki, but most of time, it does not work if you follow their instruction. Hours have passed by and you got so frustrated: we just need something simple and work. Afer hours of trials, I got the following to work:
1, In your http.conf file, under virtual host section add the following:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ /index.php?title=$1 [L,QSA]
2, In your LocalSettings.php file change
$wgArticlePath = "$wgScript?title=$1";
to
$wgArticlePath = "/$1";
So it will be:
$wgScriptPath = "";
$wgScript = "$wgScriptPath/index.php";
$wgArticlePath = "/$1";
3, Restart apache:
apachectl restart
Permalink
By PhDs, (© Copyright reserved),
August 26, 2007 at 6:05 am
· Category: MediaWiKi
There are many articles on various web sites talking about shortening URL for mediawiki, but most of time, it does not work if you follow their instruction. Hours have passed by and you got so frustrated: we just need something simple and work. Afer hours of trials, I got the following to work:
1, In your http.conf file, under virtual host section add the following:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ /index.php?title=$1 [L,QSA]
2, In your LocalSettings.php file change
$wgArticlePath = "$wgScript?title=$1";
to
$wgArticlePath = "/$1";
So it will be:
$wgScriptPath = "";
$wgScript = "$wgScriptPath/index.php";
$wgArticlePath = "/$1";
3, Restart apache:
apachectl restart
Permalink