Note that there are some explanatory texts on larger screens.

plurals
  1. POCodeigniter, domain to a certain area of the site
    primarykey
    data
    text
    <p>I'm not a very experienced programmer, and am using CodeIgniter for second time.</p> <p>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.</p> <p>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?</p> <p>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.</p> <p>Edit: I will put example of the site I want to get.</p> <p>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.com</p> <p>All 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. </p> <p>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.com</p> <p>What 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?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload