<script>try?{if(?self.location?==?“http://域名一/”?)?{?
top.location.href?=?“http://域名一/目錄”;?
}?
else?if(?self.location?==?“http://域名二/”?)?{?
top.location.href?=?“http://域名二/目錄”;?
}?
else?if(?self.location?==?“http://域名三/”?)?{?
top.location.href?=?“http://域名三/目錄”;?
}?
else?if(?self.location?==?“http://域名四/”?)?{?
top.location.href?=?“http://域名四/目錄”;?
}?
else?{document.write?(“錯誤的訪問地址”)}}?catch(e)?{}</script>
JS實現跳轉代碼:多域名指向同一空間
<script>try?{if(?self.location?==?“http://域名一/”?)?{?top.location.href?=?“http://域名一/目錄”;?}?else?if(?self.location?==?“http://域名二/”?)?{?top.location.href?=?“http://域名二/目錄”;?}?else?if(?self.location?==?“http://域名三/”?)?{?top.location.href?=?“http://域名三/目錄”;
