Code:
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var refarray = new Array();
refarray['google.com'] = "http://www.mysite.com/404.htm?from=google";
refarray['yahoo.com'] = "http://www.mysite.com/404.htm??from=yahoo";
refarray['altavista.com'] = "http://www.mysite.com/404.htm??from=altavista";
refarray['alltheweb.com'] = "http://www.mysite.com/404.htm??from=alltheweb";
refarray['msn.com'] = "http://www.mysite.com/404.htm??from=msn";
refarray['lycos.com'] = "http://www.mysite.com/404.htm??from=lycos";
refarray['infoseek.com'] = "http://www.mysite.com/404.htm??from=infoseek";
for (var i in refarray) {
if (document.referrer.indexOf(i) != -1) window.open('http://www.mysite.com/404.htm?','_top');
}
// End -->
</script>
I use it to redirect image traffic and it always worked fine. A few mins ago i decided to redirect to another url so i simply replaced the mysite part with a different url. I saved it (Wordpress) and since then the redirect completely stopped working. I can't figure out what went wrong as i didnt touch anything but the url part.