js实现域名判断后跳转到指定网址,也适用于同一虚拟空间放多个网站: 登录后复制 <script> try { if(self.location == "http://apple.baidu.com/") { top.location.href = "http://baidu.com/apple/"; } else if(self.location == "http://girl.baidu.com/") { top.location.href = "http://baidu.com/girl/"; } else if(self.location == "http://simple.baidu.com/") { top.location.href = "http://baidu.com/simple/"; } else {document.write ("错误的访问地址")} } catch(e){ } </script> 1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19. 作者:Alone°李道长ご 原创作者: u_16886903 转载于: https://blog.51cto.com/u_16886903/11529157