多域名同主机js转向

<script>try {if( self.location == "http://玉米一/index.html" ) {
top.location.href = "http://玉米一/目录";
}
else if( self.location == "http://玉米二/index.html" ) {
top.location.href = "http://玉米二/目录";
}
else if( self.location == "http://玉米三/index.html" ) {
top.location.href = "http://玉米三/目录";
}
else if( self.location == "http://玉米四/index.html" ) {
top.location.href = "http://玉米四/目录";
}
else {document.write ("错误的访问地址")}} catch(e) {}</script>

以上内容由华夏名网收集整理

原文地址:https://www.cnblogs.com/craig/p/1255161.html