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

How To Show Different Content Based On Referrer

Discussion in 'Cloaking and Content Generators' started by lotus, May 20, 2010.

  1. lotus

    lotus Junior Member

    Joined:
    Jan 27, 2008
    Messages:
    108
    Likes Received:
    25
    Hi All,

    Does anyone know how you can show 2 completely different landing pages (with the exact same url) based on the referrer?

    Say I wanted to show people who clicked thru my ad a particular page. But the general public see totally different content - however it's the exact same url = www.mysite.com/page.php

    It's not wordpress, and it's not cpa redirector. At one end it starts out with a simple form action (with a private= magic code) that somehow leads (htacess maybe?) to a hidden page. I can't see where the hidden page code is called from.

    All help very much appreciated.

    Thanks
    lotus:confused:
     
  2. lotus

    lotus Junior Member

    Joined:
    Jan 27, 2008
    Messages:
    108
    Likes Received:
    25
    No one knows? More info:

    User clicks on ad which goes to > site1.com there is a hidden javascript form that executes with a "private" value. This then redirects to:

    site2.com

    This is the site with the incentive content. However if you type in the url to the browser without going through the javascript form, the page has totally different content.

    Can anyone suggest the php code (I've got a vague idea but having problems with the if $POST= then part of it)?

    Somehow it's redirecting the content based on the form. But the url doesn't change.
     
  3. JohnKarr

    JohnKarr Junior Member

    Joined:
    Aug 12, 2009
    Messages:
    128
    Likes Received:
    22
    Occupation:
    Internet Marketer/Actor
    Location:
    Oregon
    I used Monster Clicks WP cloaker, and it had the ability to cloak to diff pages, but haven't tried V2 yet, so not sure how well it works now
     
  4. fatboy

    fatboy Elite Member

    Joined:
    Aug 13, 2008
    Messages:
    1,618
    Likes Received:
    3,232
    Occupation:
    Retired
    Location:
    Old Peoples Home
    Throw a bit of PHP code on the index page that detects the referrer (remember these can be spoofed) and then redirect on that.

    The PHP variable you need is: $_SERVER['HTTP_REFERER'];

    Have fun!
     
  5. Kuranyi

    Kuranyi Junior Member

    Joined:
    Dec 21, 2009
    Messages:
    104
    Likes Received:
    51
    Here is an easy php sample:
    PHP:
    $ref=getenv('HTTP_REFERER');
    if (
    strpos($ref,"google.com")>0
    {
    echo 
    "google";

    }
    else
    {
    echo 
    "something else";
    };
    ?>
     
  6. lotus

    lotus Junior Member

    Joined:
    Jan 27, 2008
    Messages:
    108
    Likes Received:
    25
    Thanks everyone, but that's not quite what I'm after. I realized after posting the first post that it's not referrer based. It's based on a hidden form value from site1.com.

    Basically it's a way to show your aff manager a different page of content than your ad traffic. But the url is exactly the same. Because of the url being the same, I'm thinking htaccess must be involved. Because in the source code there are no hidden divs etc. It's a completely different page with different menus etc. It must be just a redirect from htaccess? Can htaccess redirect based on POST data?
     
  7. nuntium

    nuntium BANNED BANNED

    Joined:
    Aug 27, 2009
    Messages:
    73
    Likes Received:
    25
    If I understood you right, you do not need .htaccess to do it. It can be easili coded in php. I am on my mobile now, so I won't post full code but here are some hints.
    If($_POST['hiddenform']=='sth'){
    Header("location: http://sth.com");
    }
    Else{
    // another redirect
    }

    Keep in mind that your am can just look in the source and see hidden value.
    Posted via Mobile Device