Welcome Guest, Not a member yet? Register   Sign In
CI with 2 applications (corresponding) to 2 subdomains
#1

[eluser]Ajaxian64[/eluser]
Hi all,
after reading posts I must admit that I'm a little (completely) lost.
My challenge is :
I want to make a website with 2 languages. Then I set up 2 subdomains (.fr and .en)
And I'd like to have one application per domain, those 2 applications are pointing to the same CI system core.
Is anyone did already that ?
I set up the 2 applications, I modified their respective index.php and route.php files.

I bidouille (french word to say modifying without a huge knowing of what I did) the .htaccess file.
I came to "Not Found The requested URL / was not found on this server."

any help will be very appreciate.
Patrick
#2

[eluser]rogierb[/eluser]
structure:

-root
- -app_fr
- -app_en
- -system
- -docroot_fr
- - -assets
- -docroot_en
- - - symlink assets

use a .htaccess for each of the docroots, aswell as a index.php
You probably want to maintain only one assets, so the second one is a symlink to the assets folder

Should be relatively easy to setup;-)
#3

[eluser]Ajaxian64[/eluser]
Thanks rogierb,
But I'm confuse. I don't understand what is docroot. I do not have such directory in CI.
#4

[eluser]Ajaxian64[/eluser]
I've understood. :ahhh:
Thanks
#5

[eluser]Ajaxian64[/eluser]
I set up the directories / files...
Concerning the url rewrite :
When I have http://en.monsite.com/welcome/sayhello I would like to be mapped on the welcome controler and the sayhello action located in may app_en
When I receive http://fr.monsite.com/bienvenue/ditbonjour, would be nice to be mapped on bienvenue/ditbonjour in app_fr

I know there are 3 .htaccess.
One for monsite.com
One for app_fr
One for app_en

But I'm lost with which does what and the role between .htacess and route.php
In order to make good switch to set right controller, right actions...should I dedicate the .htaccess to make some rewrite or just using route.php is enough ?
I mean is it enough to set the defaultcontroller in the route.php or should I consider to use .htacess to make some rewrite ?
I try without rewriting and it seems to not work.
Thanks in advance




Theme © iAndrew 2016 - Forum software by © MyBB