When I changed my domain name, I planed three subdomains for the future usage: www, blogs and wiki, while unfortunately at that time only the blogs.dbcloudsvc.com had some contents and in fact it was migrated from previous www.lunixdb.com.
Now I have installed the Mediawiki and the wiki.dbcloudsvc.com is online, so the first thing I want to do is about the permanent link, or short url in Mediawiki world.
Need the following two steps:
- Update the file LocalSettings.php
- [root@www wiki]# diff LocalSettings.php*
- 29,30d28
- < $wgArticlePath = "/$1";
- < $wgUsePathInfo = true;
- [root@www wiki]# ls LocalSettings.php*
- LocalSettings.php LocalSettings.php.bak
- Add the rewrite rule for Mediawiki in the nginx configuration file
- # MediaWiki Rewrite
- if ($host = wiki.dbcloudsvc.com) {
- set $nrw W;
- }
- if (!-e $request_filename) {
- set $nrw "${nrw}Y";
- }
- if ($nrw = WY) {
- rewrite ^/([^?]*)(?:\?(.*))? /index.php?title=$1&$2 last;
- }
For me, www and wiki subdomains share the same configuration file, so I have to check which one is accessed.
And I began to write my first installation page on the wiki.