views:

75

answers:

1

I have domains like www.football.com and www.baseball.com.

They are linked with www.game.com, which is the parent, and its admin page, www.game.com/admin.

i want to create something like www.football.com/userid1/admin, www.baseball.com/userid2/admin, etc. for different users.

All the domains are mapped to same IP and there is only one admin folder. If I use CakePHP, is it possible to achieve the above?

+1  A: 

It's simple to do, but gets nitpicky in the details. You configure Apache to point all those domains to the same set of PHP files, then you simply check $_SERVER['HTTP_HOST'] to see which domain was actually requested:

switch ($_SERVER['HTTP_HOST']) {
   case 'www.baseball.com':
   case 'baseball.com':
        // do baseball.com stuff here
        break;
   case 'www.football.com':
   case 'football.com':
        // football stuff here
    default:
       // just in case no valid hostname was given (e.g. coming in via IP only)
       // do default stuff here
}

With appropriate care in the rest of your code and templates, you can easily determine which site's images/stylesheets/content to output, but basically use the same core logic for all of them.

Marc B