1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

is there a script that can forward to a particular website based on the referrer?

Discussion in 'Cloaking and Content Generators' started by tmelan, Feb 21, 2012.

  1. tmelan

    tmelan Newbie

    Joined:
    Oct 28, 2011
    Messages:
    15
    Likes Received:
    2
    eg, if it came from url A - forward to url B or if it came from url C - forward to url D .. Just wondering if such a script exists?
     
  2. moviedemands

    moviedemands BANNED BANNED

    Joined:
    Jun 22, 2011
    Messages:
    203
    Likes Received:
    156
    You can do this a few ways..

    PHP -

    Code:
    <?
    $referrer = $_SERVER['HTTP_REFERER'];
    if (preg_match("/site1.com/",$referrer)) {
          header('Location: http://www.customercare.com/page-site1.html');
    } elseif (preg_match("/site2.com/",$referrer)) {
          header('Location: http://www.customercare.com/page-site2.html');
    } else {
          header('Location: http://www.customercare.com/home-page.html');
    };
    ?>
    Adding it to htaccess - http://opensourcehacker.com/2011/09/19/http-referer-based-redirects-in-apache/

    Here - http://lmgtfy.com/?q=redirect+traffic+based+on+referrer