Codeigniter, domain to a certain area of the site

djrikyx

New Member
I'm not a very experienced programmer, and am using CodeIgniter for second time.Suppose I have www.domain1.com. So I will have, say 3 controllers /area1, /area2, /area3. Users can access them as www.domain1.com/area1 etc. if I set the base URL as www.domain1.com. But my problem is, the client wants a certain area of the web, say area2, working as a microsite, in its own domain, so he wants to access area2 with www.domain2.com.I don't know how to get this working with CodeIgniter. Suppose he registers www.domain2.com and set it pointing to the same DNS, server etc. How can I get CodeIgnitor to execute the controller area2 when the URL www.domain2.com is accessed?Maybe changing \[code\]$config['base-url']\[/code\]? Routing? \[code\].htaccess\[/code\]? Please, if you have solved this, examples of code involved would be greatly appreciated.Edit: I will put example of the site I want to get.I have one normal installation of CodeIgniter (external host, I can't access \[code\]httpd.conf\[/code\]) It is on one machine, and the root of the site should be accessed by www.domain1.comAll domain are outside registered to. So I have the home controller, which shows me the main page view. And suppose the site have 3 areas /area1, /area2 /area3, with their correspondent controllers, showing these areas views. My client want to emphasize one of the areas, the one that controller /area2 shows, and he want use a different domain for that area, www.domain2.comWhat can I do so that when the user browse to www.domain2.com, CI redirects them to www.domain1.com/area2? Could I, for example, modify \[code\]$config['base_url']\[/code\] according the received URL, or is that impossible? Do I need to modify the \[code\].htaccess\[/code\] file?
 
Back
Top