Welcome Guest, Not a member yet? Register   Sign In
Mutliple Base URLs?
#1

[eluser]Kyle Johnson[/eluser]
Good Afternoon Everyone,

TGIF.

Anyways, I'm developing a project that will be used both clients as well as subsidiary companies.

I would like our clients to goto www.oursite.com and see our logo and all that fun stuff specific to our company.

However, the subsidiary companies will be using the same system, but they are wanting to have their logo be shown instead and they will be mapping a DNS record to www.theirsite.com that will direct to our services here.

I'm wondering if this is at all possible with the configuration within CI.

Thank you!

Smile

Kyle
#2

[eluser]NMTeck[/eluser]
Anything is probably possible if you put your mind to it.

You can probably try using CI to read the URL and change the base url based on that. Another little trick that may work if you know how, is changing the css class of the page based on the URL. Then you can style whatever look you want for that class.

Let me know if those could work for ya.
#3

[eluser]Kyle Johnson[/eluser]
[quote author="NMTeck" date="1248491872"]Anything is probably possible if you put your mind to it.

You can probably try using CI to read the URL and change the base url based on that. Another little trick that may work if you know how, is changing the css class of the page based on the URL. Then you can style whatever look you want for that class.

Let me know if those could work for ya.[/quote]

Thank you for the ideas!

So I set up something like this for the base_url

Code:
/*
if($_SERVER['SERVER_NAME'] == 'ourmain.website.com')
{
    $config['base_url']    = "http://ourmain.website.com/ci/";
} else if($_SERVER['SERVER_NAME'] == 'the.othersite.com'){
    $config['base_url']    = "http://the.othersite.com/ci/";
} else {
    $config['base_url'] = "http://" & $_SERVER['SERVER_NAME'] & "/ci/";
}
*/
switch($_SERVER['SERVER_NAME'])
{
    case 'ourmain.website.com':
        $config['base_url']    = "http://ourmain.website.com/ci/";
        break;
    case 'the.othersite.com':
        $config['base_url']    = "http://the.othersite.com/ci/";
        break;
    default:
        $config['base_url'] = "http://".$_SERVER['SERVER_NAME']."/ci/";
        break;
}
I decided a switch statement would be best suited for the job, so if I have to make any further changes I can do that.

From here it will be easy to do the same with stylesheets.

Thanks again!!! Smile
#4

[eluser]NMTeck[/eluser]
No prob




Theme © iAndrew 2016 - Forum software by © MyBB