CodeIgniter Forums
CI support multi domains and Internationalization i18n? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: CI support multi domains and Internationalization i18n? (/showthread.php?tid=6836)



CI support multi domains and Internationalization i18n? - El Forum - 03-13-2008

[eluser]Tony Nash[/eluser]
I knew EE can work with multi domains (sites) and CI born from EE. Dose CI support multiple domains and internationalization with single CI installation? I saw CI clone Kohanaphp support both. Any luck with these features or roadmap?


CI support multi domains and Internationalization i18n? - El Forum - 03-13-2008

[eluser]sikkle[/eluser]
This is not simple as a config file, but i mean, you can do whatever you want to make it work i18n, most of
my app run on multi language etc. etc.


One step to start will be to give a look into the wiki.

see ya around.


CI support multi domains and Internationalization i18n? - El Forum - 03-14-2008

[eluser]frenzal[/eluser]
It's possible if you can play around with your apache config. I got it working:
invenso.com, convenso.com/nl and convenso.com/en is one CI project


CI support multi domains and Internationalization i18n? - El Forum - 03-14-2008

[eluser]Tony Nash[/eluser]
Hi frenzal, I am running on Apache. Would you mind sharing this knowledge? If not here please PM me or could you direct me to some tutorial?

Also has anyone try Kohanaphp method for internationalization with CI? (http://kohanaphp.com/tutorials/multilingual.html) Will it work without any hacks to CI core? (I am a CI lover ;-)


CI support multi domains and Internationalization i18n? - El Forum - 03-14-2008

[eluser]frenzal[/eluser]
most of it comes down to rewriting, first I make sure my site works like this
site.com - main site
site.com/site2-en - second site, english
site.com/site2-nl - second site, dutch


Here's the rewriting i did in httpd.conf, I don't know it's all necesary and it's probably not the best way but it worked

ServerAlias site2.com www.site2.com
RewriteCond %{HTTP_HOST} site2.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.site2\.com$
RewriteCond %{REQUEST_URI} !^/vdir_site2/
RewriteCond %{REQUEST_URI} !error_docs
RewriteRule (.*) http://www.site.com/vdir_site2/$1

Looking back at it I wonder why I couldn't get it all done with my first rewrite, but in the vdir_site2 I have a htaccess that does the following:

RewriteRule ^(nl|en)(.*)$ /site2-$1/$2 [QSA]
RewriteRule ^$ /site2/langselect [QSA]

So when I go to site2.com I get send to my site2 language selecting controller. and if I go to site2.com/en or site2.com/nl I'm basically on site.com/site2-en or site.com/site2-nl and CI takes it from there.


CI support multi domains and Internationalization i18n? - El Forum - 03-14-2008

[eluser]Tony Nash[/eluser]
Thanks you very much frenzal.

Looks like I have to play with my server tonight Smile

Basicaly my requierment similer to yours. ex: I need my main site work like

example.com (/en/ site)
example.com/en/page
example.com/nl/page

I am very like the idea at http://kohanaphp.com/tutorials/multilingual.html. But I am CI guy :-)..

<b>Has anyone try something similar to that with CI?</b>