CodeIgniter Forums
multidomain setup routing and index.php question - 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: multidomain setup routing and index.php question (/showthread.php?tid=32284)



multidomain setup routing and index.php question - El Forum - 07-19-2010

[eluser]Gewa[/eluser]
Hi all,
I am trying to make a multidomain setup of codeigniter.

I need to support links like this


www.site.com/users/username
subdomain.site.com
www.othersiteparkedonsite.com


in this 3 different cases i want to load application folder regarding the case

following code will work only with subdomain and domain case
Code:
// Application folder var
$myApp = '';

switch($_SERVER['HTTP_HOST'])
{
    case 'site.com':
        $myApp = 'application';
        break;

     default:
        $myApp = str_replace('.','_',$_SERVER['HTTP_HOST']);
        $myApp=str_replace('www_','',$myApp);
        $myApp='sites/'.$myApp;
    }
    
$application_folder = $myApp;


but how to identify the first case ????

how to make routing , or with htaccess so that I can load application folder regarding the username
from www.site.com/users/username



from /usersites/ folder, subdomains from /subdomains/ folder and domains from /domains/ folder
and also

www.site.com/somecontroller/somefunction will work from the main /application folder ????


multidomain setup routing and index.php question - El Forum - 07-19-2010

[eluser]Phil Sturgeon[/eluser]
I've picked this up over at SO.

http://stackoverflow.com/questions/3279259/codeigniter-multidomain-setup-question/3279440#3279440


multidomain setup routing and index.php question - El Forum - 07-19-2010

[eluser]Gewa[/eluser]
to tell the truth, i didn't get the method ...Sad(((((