Welcome Guest, Not a member yet? Register   Sign In
Different domains in one isntallation
#1

[eluser]javigarrido[/eluser]
Hi, i`m a new (an enthusiastic) Codeigniter user, doing my fist not-simple development, and i have a question i think could be of use for other members to:

Lest supose i have an Codeigniter made site, with different parts, the main site page wold be accesed by www.domain2.com (just examples). But i have a certain area of the web i want to act as a microsite, and it to be referenced as www.domain2.com.

example, site home www.domain1.com, and then www.domain1.com/area1, www.domain1.com/area2, www.domain1.com/area3. I would like www.domain1.com/area2, that is a important zone, to be reached as www.domain2.com (and then be able of use base_url() and suchfeatures inside that area views to call controlers with that domain, etc.

I hope it is undestandable. Is there an easy way to do this? Can please get any example of how getting this, no matter the method?

Thanks in advance, and excuse my english, not my native languaje.
#2

[eluser]OliverHR[/eluser]
This could be done if you try with .htaccess and httpd-vhosts.
#3

[eluser]javigarrido[/eluser]
I forgot to say that the page will end in an external host, where i have not access to http.conf or similar configuration functions of the web server. The plan is to develop the especial area as another part of the site (his controler being /area2 etc...) and when going to the external hosting, the client buys the 2 diferent domains, and then access the /area2 withe www.domain2.com

Plz tell me if you need more explanations, im not really used to .htaccess configuration. Kinda newbie trying to learn Smile
#4

[eluser]OliverHR[/eluser]
Some hosting services now provide CI as an "One click install Aplication", I am from Mexico and this hosting service run Codeigniter.

See in section "varios":
http://www.neubox.com/installatron.php
#5

[eluser]javigarrido[/eluser]
More ideas? i was hoping for something like a .htaccess or $routes modifys could be enough ... i have to tell times to client asap, and i can't if i don't know how to do this part of the work, else i would be searching/trying by myself.

Thx in advance again.
#6

[eluser]javigarrido[/eluser]
No replys , so i suspect there is not easy way to do this?

at laeast any idea i can start researching?

EDIT:

OMG after a lot of trying, i found a solution that seems to work, very easy to be honest:

modify routes.php:

if ($_SERVER['HTTP_HOST']=="www.domain2.com") { $route['default_controller'] = "area2"; }

No need of mod rewrite....




Theme © iAndrew 2016 - Forum software by © MyBB