Quote:
Originally Posted by rosx
sarettah this worked with me just after doing little change
Code:
if (document.referrer.indexOf('https://gfy.com/') > -1)
{
window.location='http://yahoo.com';
}
else if (document.referrer.indexOf('https://gfy.com/forum') > -1)
{
window.location='http://msn.com';
}
else
{
window.location='http://www.google.com';
}
|
Well, it appears to me that you will never send anyone to msn.com with that.
Your first condition document.referrer.indexOf('https://gfy.com/') > -1 should send anyone from gfy to yahoo. Since the second condition also includes the first condition it will never be hit.
So, if you wanted to do that switch condition 1 and 2 around. Make condition 1 be gfy.com/forum and condition 2 be just gfy. That way the ones to the forums will be redirected to msn and then anyone else from gfy will be redirected to yahoo.
I had done the exact match conditions because you had included specific pages in your example. As I said, it was a very simple version.
Glad it worked for you.
.