您所在的位置:首页 > 建站动态 > 技术知识 > 内容
  • 技术知识

根据IP判断页面跳转

SDCMS模板堂 与 2019/7/11 18:06:42 发布此文章 人气:299   技术知识
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <!-- 页面爬虫设置 -->
    <meta name="robots" content="index,m,follow">
    <!-- 禁止从本地缓存中读取页面 -->
    <meta http-equiv="Pragma" content="no-cache">
    <title>Document</title>
</head>
<body>
    <script src="https://ip.ws.126.net/ipquery"></script>
    <script>
       
        //------------------------------------------------------------
        var nowhost = window.location.host;
        //主域名
        var domain = [
        "m1.ximayun.cn",       
        ];
        //跳转落地页域名
        var tz_domain = [
        "http://d3.6idue.cn",
        ];
        //屏蔽地区
        if(lo=='北京市'|| lc=='北京市'|| lo=='杭州市'|| lc=='杭州市'|| lo=='广州市'|| lc=='广州市'|| lo=='深圳市'|| lc=='深圳市' || lo=='武汉市' ||  lc=='武汉市' ){
          //审核页路径(留在本页面的话,直接将下行跳转去掉,无需跳转)    
          window.location.href='shen/index.html';
            }else{
          //推广页路径(留在本页面的话,直接将下行跳转去掉,无需跳转)
          //window.location.href='';
             for(i=0;i<domain.length;i++){
              if(domain[i]==nowhost){
                 window.location.href = tz_domain[i];
                }
            }
        }
       
    </script>
</body>
</html>


本文网址:http://www.sdmoban.com/jishuzhishi/473.html
  • 栏目分类
  • 热卖商品
更多>>
  • 建站动态
SDCMS模板堂 - 成功的竞争者应该经得起风雨,应该具有抗挫折的能力。在竞争中流泪是弱者,只有在困境中奋起,才能成为强者。

推荐模板