In your header.inc.php (Backup this file even before opening it. Earth will smash into moon if you mess this file)
$sReqestedDomain = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : 'evil world';
$aAllowedDomains = array('main.domain', 'other.domain', 'probably.more', 'enough.now');
$sTheDomain = $aAllowedDomains[0];
if(in_array($sReqestedDomain, $aAllowedDomains)) {
$sTheDomain = $sReqestedDomain;
}
Modify this line
$site['url'] = "http://{$sTheDomain}/";
and i hope it works
Note: The above procedure is not tested or verified for real world cases in any way. Use it on your own risk. If you mess this up, too bad. If you don't, enjoy....i guess.
so much to do....