代码如下,可以根据实际情况对变量进行修改:
<?php $domain01="www.weste.cn"; $domain02="it.weste.net"; $url01="/home01/"; $url02="/home02/"; if(($HTTP_HOST=="$domain01")or($HTTP_HOST=="www.$domain01")) { Header("Location: $url01"); } elseif(($HTTP_HOST=="$domain02")) { Header("Location: $url02"); } else { include_once('index.php'); } ?>