/    Sign up×
Community /Pin to ProfileBookmark

Referral redirect script question

A large number of my site visitors are coming to my homepage via links on three or four other sites. I want to redirect these visitors from my homepage to a subpage on my site. I’ve been looking for a script and found the one pasted below; however, I’m unsure how to use it. The developer’s instructions just said paste it into my code, but I have to assume that somewhere I have to identify the three referring sites that I want to redirect, and the subpage on my site I want to redirect to.

Can anyone help me better understand this script?

<!– ONE STEP TO INSTALL REFERRER REDIRECT:

  • 1. Copy the coding into the HEAD of your HTML document –>
  • <!– STEP ONE: Paste this code into the HEAD of your HTML document –>

    <HEAD>

    <SCRIPT LANGUAGE=”JavaScript”>
    <!– Original: Ronnie T. Moore, Editor –>
    <!– Web Site: [url]http://javascriptsource.com[/url] –>

    <!– This script and many more are available free online at –>
    <!– The JavaScript Source!! [url]http://javascript.internet.com[/url] –>

    <!– Begin
    var refarray = new Array();
    refarray[‘excite.com’] = “page.html?from=excite”;
    refarray[‘yahoo.com’] = “page.html?from=yahoo”;
    refarray[‘lycos.com’] = “page.html?from=lycos”;
    refarray[‘infoseek.com’] = “page.html?from=infoseek”;
    for (var i in refarray) {
    if (document.referrer.indexOf(i) != -1) window.location.replace(refarray[i]);
    }
    // End –>
    </script>

    <p><center>
    <font face=”arial, helvetica” size=”-2″>Free JavaScripts provided<br>
    by <a href=”http://javascriptsource.com”>The JavaScript Source</a></font>
    </center><p>

    <!– Script Size: 0.84 KB –>

    to post a comment
    JavaScript

    2 Comments(s)

    Copy linkTweet thisAlerts:
    @Mr_JJun 13.2005 — At the array index such as

    refarray['excite.com'] = "page.html?from=excite";

    change [B]excite.com[/B] to your refering site and [B]page.html[/B] to your redirect page.

    refarray['[B]referingSite1[/B]'] = "[B]redirect1.html[/B]"

    if you need the query string then just add it on.

    do the same for the other indexes, those you don't need just delete
    Copy linkTweet thisAlerts:
    @lightwaveauthorJun 13.2005 — Thank you. This confirms what I suspected, but I didn't want to mess it up without asking an expert. I'll give it a try!

    Thanks.
    ×

    Success!

    Help @lightwave spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 5.16,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @AriseFacilitySolutions09,
    tipped: article
    amount: 1000 SATS,

    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,
    )...