MediaWiki: URL beautification HowTo
The default [[MediaWiki]] installation will leave you with [[URL]]s of the type:
This is ugly! Following instructions at the MediaWiki.org site, you can make it simpler and nicer:
To achieve that, add the following to /etc/apache2/httpd.conf:
Alias /wiki /usr/share/mediawiki/index.php
Then add/modify the following at /var/lib/mediawiki/LocalSettings.php (again, Debian default path):
$wgArticlePath = '/wiki/$1'; # This directory MUST be different from $wgScriptPath
$wgUsePathInfo = true;
Recall that you must have two “directories”, which in the example above are /w and /wiki. The former is “real” and the latter is “virtual”.
The real dir (the one used as value for $wgScriptPath) must contain the MediaWiki files, thus it must point to the /usr/share/mediawiki dir. To this end, it must either exist in the [[Apache HTTP Server|Apache]] root (usually /var/www/), or be an alias. If you follow the first route, you can make a link, like in the following example:
The second route would imply adding this line to /etc/apache2/httpd.conf:
The latter requires restarting the Apache daemon, but I personally prefer it.
The virtual dir (the one used as value for $wgArticlePath) will be our path to get rid of the URL ugliness, and point directly to an article’s title. As such, it must be aliased in /etc/apache2/httpd.conf adding the following line to it, as mentioned above:
Finally, you shold enable the rewrite
PHP module, if it’s not enable already, and reload Apache:
% ln -s ../mods-available/rewrite.load .
% /etc/init.d/apache2 reload
After that, pointing to website/wiki/somearticle should lead you to the wiki page for somearticle. For more information, refer to the MediaWiki.org site.
Lurlene said,
April 20, 2015 @ 10:05 am
You actually make it appear so easay along with your presentation however I
to find this matter to be really one thing which I think I’d never understand.
It sesms too complicated and extremely broad for me.
I am taking a look forward for your next post, I’ll attempt to get the hang of it!
m88 สำรà¸à¸‡ said,
July 31, 2015 @ 22:48 pm
At this moment I am going away to do my breakfast, later than having my breakfast coming again to read other news.