Best way to redirect traffic so it looks like its coming from a certain source

Discussion in 'Programming' started by mberman84, Aug 22, 2008.

  1. #1
    basically what i want to do is send traffic to my website (www.website1.com) and then redirect it to another website (www.website2.com). i will be buying traffic from a source (www.website0.com) and i want website2 to get this traffic but i want it to look like its coming from website1.
     
    mberman84, Aug 22, 2008 IP
  2. Vooler

    Vooler Well-Known Member

    Messages:
    1,146
    Likes Received:
    64
    Best Answers:
    4
    Trophy Points:
    150
    #2
    Simplest method

    $url = parse_url($_SERVER['HTTP_REFERER']);
    switch($url['host']) {
        case 'google.com':$redirect="someurl_when_traffic_is_from_google"; break;
        case 'yahoo.com':$redirect="someurl_when_traffic_is_from_yahoo"; break;
        case 'msn.com':$redirect="someurl_when_traffic_is_from_msn"; break;
        default: #unknown referer
             $redirect = "http://www.mysite.com"; 
    }
    
    header("Location: $redirect");
    Code (markup):
    I hope it helps.

    regards
     
    Vooler, Aug 24, 2008 IP
  3. mberman84

    mberman84 Peon

    Messages:
    511
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #3
    are you sure this works? i tried the the "location" method and it still appeared as if the traffic came from the original source. what is the reason for the ysm, google, switch code?
     
    mberman84, Aug 26, 2008 IP
  4. Vooler

    Vooler Well-Known Member

    Messages:
    1,146
    Likes Received:
    64
    Best Answers:
    4
    Trophy Points:
    150
    #4
    function header might not be working, becuase of some character or text already sent before it.

    regards
     
    Vooler, Aug 26, 2008 IP
  5. mberman84

    mberman84 Peon

    Messages:
    511
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #5
    what does that mean?
     
    mberman84, Aug 26, 2008 IP
  6. Fersk

    Fersk Guest

    Messages:
    28
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    put it at the very top of your page i would try...
     
    Fersk, Aug 26, 2008 IP
  7. mberman84

    mberman84 Peon

    Messages:
    511
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #7
    this method doesn't work. still shows referring site as the other site.
     
    mberman84, Aug 26, 2008 IP
  8. mberman84

    mberman84 Peon

    Messages:
    511
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #8
    this method doesn't work. still shows referring site as the other site.
     
    mberman84, Aug 26, 2008 IP