Installing multilingual MediaWiki under the same domain

Multilingual is such a common thing today. Wikipedia has multilingual in subdomain. So you may read Wikipedia in English at http://en.wikipedia.org/ and in Thai at http://th.wikipedia.org/. I like it. Anyway, it will not look that pretty if your domain is not just for wiki. For example, http://www.thaigrid.or.th/ which has its wiki at http://research.thaigrid.or.th/. According to subdomain approach, they will have multilingual as follows.

  1. http://en.research.thaigrid.or.th/wiki/Main_Page
  2. http://th.research.thaigrid.or.th/wiki/หน้าหลัก

My oh my. I expect it shoud be as follows instead.

  1. http://research.thaigrid.or.th/en/Main_Page
  2. http://research.thaigrid.or.th/th/หน้าหลัก

The point is how to do it easily. Below are my steps.

  1. Install MediaWiki for English language in /wen.

  2. Make sure that LocalSettings.php is correct.

    • $wgScriptPath = "/wen";
    • $wgArticlePath = "/en/$1";
  3. Install MediaWiki for Thai language in /wth.

  4. Make sure that LocalSettings.php is correct.

    • $wgScriptPath = "/wth";
    • $wgArticlePath = "/th/$1";
  5. Modify httpd.conf.

    Alias /wiki /var/www/research.thaigrid.or.th/wen/index.php
    Alias /index.php /var/www/research.thaigrid.or.th/wen/index.php
    Alias /en/index.php /var/www/research.thaigrid.or.th/wen/index.php
    Alias /th/index.php /var/www/research.thaigrid.or.th/wth/index.php
    Alias /en /var/www/research.thaigrid.or.th/wen/index.php
    Alias /th /var/www/research.thaigrid.or.th/wth/index.php
    

As a result, http://research.thaigrid.or.th/ and http://research.thaigrid.or.th/en/ is redirected to English language while http://research.thaigrid.or.th/th/ is redirected to Thai language.

Tags: , ,

Post new comment