Welcome Guest, Not a member yet? Register   Sign In
multidomain setup routing and index.php question
#1

[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 ????
#2

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

http://stackoverflow.com/questions/32792...40#3279440
#3

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




Theme © iAndrew 2016 - Forum software by © MyBB