+ Reply to Thread + Post New Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: How To Show Different Content Based On Referrer

  1. #1
    Noobie
    Join Date
    Apr 2008
    Posts
    77
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default How To Show Different Content Based On Referrer

    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

  2. Shorten URL    SEO Services    Buy Xrumer

    Sponsored Links

  3. #2
    Noobie
    Join Date
    Apr 2008
    Posts
    77
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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.

  4. #3
    Noobie
    Join Date
    Apr 2008
    Posts
    105
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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

  5. #4
    Noobie
    Join Date
    Apr 2008
    Posts
    297
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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!

  6. #5
    Noobie
    Join Date
    Apr 2008
    Posts
    33
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Here is an easy php sample:
    PHP Code:
    $ref=getenv('HTTP_REFERER');
    if (
    strpos($ref,"google.com")>0
    {
    echo 
    "google";

    }
    else
    {
    echo 
    "something else";
    };
    ?> 

  7. #6
    Noobie
    Join Date
    Apr 2008
    Posts
    77
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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?

  8. #7
    Noobie
    Join Date
    Apr 2008
    Posts
    37
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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

+ Reply to Thread
Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts