با تشکر از دوست عزیز id1385
یخورده با کد کلنجار رفتم ولی درست شد.
کد رو میذارم اینجا که دوستان هم استفاده کنند.
<?php
function GetDomain($url)
{
$nowww = str_replace('www\.','',$url);
$domain = parse_url($nowww);
if(!empty($domain["host"]))
{
return $domain["host"];
} else
{
return $domain["path"];
}
}
if($_SERVER['HTTP_HOST']=='zigoratsoft.tk')
{echo '<head><title>wait...</title><meta http-equiv="refresh" content="0; URL=http://***.zigorat.tk"></head>';}
if($_SERVER['HTTP_HOST']=='demo.zigoratsoft.com')
{echo '<head><title>wait...</title><meta http-equiv="refresh" content="0; URL=http://zigoratsoft.com"></head>';}
?>