使用codeigniter的多语言站点

I want to setup a multi language site for my web app. But I'm rather confuse on where to start. I'm using Codeigniter and hosted my domain in a cpanel server.

What I want to have is multi language with subdomains such as:

en.abc.com for english
id.abc.com for indonesia

So far, I have set up the advanced DNZ Zone editor and point the subdomains to the server IP address. But, I don't know what to do next. I have read on some tutorial to set the .htaccess, etc. But it doesn't work.

This is my .htaccess file:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^(/index\.php|/assets|/robots\.txt|/favicon\.ico)
RewriteRule ^(.*)\.html$ /index.php/$1 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^(/index\.php|/assets|/robots\.txt|/favicon\.ico)
RewriteRule ^(.*)$ /index.php/$1 [L]

RewriteCond %{HTTP_HOST} ^en\.lokadok\.co.id$
RewriteCond %{REQUEST_URI} !^/en/
RewriteRule (.*) /en/$1

RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
</IfModule>

<IfModule !mod_rewrite.c>
ErrorDocument 404 /index.php
</IfModule>

I got the 404 not found error everytime I access the subdomains which redirected to address like:

http://www.en.abc.com/en/index.php/en/ 

My question is, from where should I start implement it?

Thanks.

For me this looks like a structure problem rather than a CI problem but i'll give you some thought about it

  1. You should think about whether you need different models and controllers per language or not.

  2. If you need different models etc. simply create 2 different CI installations. For example - since you are using Apache, i give you a concrete example: Make in your document root Folder for each language a folder and point any subdomain via vhost to the appropriate directory. As alternative you can use CI as a mulitple application environment take a look at this link

  3. if you wish to choose the same models, controllers and views, you really have to think about your routing. Do you wish the same url names for all languages or do you like language dependent urls (for this purpose you should think about a pre controller hook with a DB System behind of that to choose where the link should route to the desired controller)

  4. in your url http://www.en.abc.com/en/index.php/en/ there are too much "ens". In fact if you have a language prefix as subdomain you don't need "en" at all as a suffix. En.abc.com is the way to go.