标签:http io sp strong on bs ef tt nbsp
js实现域名判断后跳转到指定网址,也适用于同一虚拟空间放多个网站:
<script>
try
{
if(self.location == "http://apple.ya37.com/")
{
top.location.href = "http://ya37.com/apple/";
}
else if(self.location == "http://girl.ya37.com/")
{
top.location.href = "http://ya37.com/girl/";
}
else if(self.location == "http://simple.ya37.com/")
{
top.location.href = "http://ya37.com/simple/";
}
else {document.write ("错误的访问地址")}
}
catch(e){ }
</script>
看明白了吧,如果访问者输入的域名是"http://apple.ya37.com/"的话,就访问"http://ya37.com/apple/"。
标签:http io sp strong on bs ef tt nbsp
原文地址:http://www.cnblogs.com/tanlingdangan/p/4152083.html