I am not a very experienced programmer, and I use CodeIgniter for the second time.
Suppose I have www.domain1.com. Therefore, I will have, say, 3 controllers / area 1, / 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 that the client wants a certain area of the Internet, say, area2, working as a microsite, in his own domain, so he wants to access area2 using www.domain2.com.
I do not know how to do this with CodeIgniter. Suppose he registered the site www.domain2.com and established that he points to the same DNS, server, etc. How can I get CodeIgnitor to execute controller2 scope when accessing the www.domain2.com URL?
Perhaps a change to $config['base-url'] ? Routing .htaccess ? Please, if you have decided this, you should take into account code usage examples.
Edit: I will put an example of the site I want to get.
I have one normal installation of CodeIgniter (external host, I can not access httpd.conf ). It is located on the same machine, and the root of the site should be contacted at www.domain1.com
The entire domain is outside the registered domain. So, I have a home controller that shows me the main page. Suppose the site has 3 areas / area 1, / area2 / area3, with the corresponding controllers displaying these areas.
My client wants to emphasize one of the areas that the controller / area2 shows, and he wants to use another domain for this area, www.domain2.com
What can I do so that when a user goes to www.domain2.com, CI redirects them to www.domain1.com/area2? Can I, for example, change $config['base_url'] according to the received URL, or is this impossible? Do I need to modify a .htaccess file?