javascript redirect based on referral url

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ztik
    Confirmed User
    • Aug 2001
    • 5196

    #1

    javascript redirect based on referral url

    I used to have this code, I tried recoding it myself but I suck, google also sucks

    Anyone have this code handy?

    If ref url = aol.com then newurl=google.com

    this is kind of close

    if (document.referrer != "") {
    var referringURL = document.referrer;
    var local = referringURL.substring(referringURL.indexOf("?"), referringURL.length);
    location.href = "http://page.com/login" + local;
    }
    .
Working...