Welcome Guest, Not a member yet? Register   Sign In
Using multiple application in single CI folder?
#1

[eluser]Zeeshan Rasool[/eluser]
hi ,
i need some help here.... i am using multiple sites in single CI system folder. There is index file which contains checks to determine the controller name so that it loads the requested application folder. Application folders are separated here . Can we use single application folder so that it may be much compressed and much eazy to organize

Code:
$application_folder='application';

if(strpos($_SERVER['REQUEST_URI'],'/admin',0))
{
    $application_folder    = 'admin_application';
}
elseif(strpos($_SERVER['REQUEST_URI'],'/first_site',0))
{
    $application_folder    = 'first_application';
}
elseif(strpos($_SERVER['REQUEST_URI'],'/me_site',0))
{
    $application_folder    = 'me_application';
}
elseif(strpos($_SERVER['REQUEST_URI'],'/second_site',0))
{
    $application_folder    = 'second_application';
}
elseif(strpos($_SERVER['REQUEST_URI'],'/super_admin',0))
{
    $application_folder    = 'super_application';
}
elseif(strpos($_SERVER['REQUEST_URI'],'/third_site',0))
{
    $application_folder    = 'third_application';
}

thanks
#2

[eluser]kevinprince[/eluser]
Right,

Are you trying to run multiple apps on one domain?

If so there is a more graceful solution.

Base Folder

/user
/user/ci (one copy of CI system)
/user/apps (your application folders eg contacts, accounting)
/user/sites (your sites e.g. contacts.domain.com)


Apache is configured to serve /user/sites/sitename

In /user/sites/sitename/index.php you setup the location of the system and app folders as follows:

/user/ci for the ci system
/user/apps/appname for the application

Hope this helps




Theme © iAndrew 2016 - Forum software by © MyBB