pointing multiple domains to same instance of CI - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: pointing multiple domains to same instance of CI (/showthread.php?tid=12118) |
pointing multiple domains to same instance of CI - El Forum - 10-06-2008 [eluser]niyogi[/eluser] we need to point multiple domains to the same instance of codeigniter. As the user browses from page to page, they should remain on the same domain. Does anything special need to be done to achieve this? To make things a little bit more complicated we need each domain to point to a specific controller. How would we do this? You're help is greatly appreciated! pointing multiple domains to same instance of CI - El Forum - 10-06-2008 [eluser]Colin Williams[/eluser] Assuming Apache: Code: NameVirtualHost *:80 And then in routes: Code: $check_host = $_SERVER['SERVER_NAME']; pointing multiple domains to same instance of CI - El Forum - 10-06-2008 [eluser]niyogi[/eluser] This is awesome to see. Thanks so much Colin. I will try this out and see how things go. Which part keeps you on the domain and not send you to the base_url domain upon navigation to another page? Or am I assuming incorrectly in the first place? pointing multiple domains to same instance of CI - El Forum - 10-07-2008 [eluser]Colin Williams[/eluser] Either set your base_url to "/" or do the same check I did above Code: $check_host = $_SERVER['SERVER_NAME']; pointing multiple domains to same instance of CI - El Forum - 10-07-2008 [eluser]niyogi[/eluser] Colin Thanks again for this - I was able to use your code examples/suggestion as hints and make this all work. CI rocks. pointing multiple domains to same instance of CI - El Forum - 06-29-2009 [eluser]Iverson[/eluser] If I'm understanding the question correctly, there's no reason to touch the controllers. If you just need exampleA.com and exampleB.com to be the exact same thing (database included), all you need to do is go inside the config.php and use: Code: $host = $_SERVER['SERVER_NAME']; // resolves to www.exampleA.com OR www.exampleB.com I use this method currently on a site. |