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

Redirect script not working – can someone please help!

Discussion in 'Black Hat SEO' started by streetjammer, Sep 10, 2008.

  1. streetjammer

    streetjammer BANNED BANNED

    Joined:
    Sep 25, 2008
    Messages:
    115
    Likes Received:
    5
    Hi Guys!

    I am trying to build a small script that can do some redirect for me. But after some unsuccessful hours searching for something like it I gave up :(

    Here is what i am trying to make:

    If and only if visitors come from: example1.com --> then random auto redirect to a list of web pages. (I have seen this before in JS)

    If visitors come from any other url than example1.com --> then auto redirect to example2.com

    I then need the referrer url for the first scenario to be example3.com and the second scenario to be example4.com

    Can someone please help a friend in need?

    Thanks in advance :D
     
    Last edited: Sep 10, 2008
  2. iezcha

    iezcha Registered Member

    Joined:
    Dec 21, 2007
    Messages:
    52
    Likes Received:
    2
    use MetaRefreshGenerator V2 ....
     
  3. bosshog

    bosshog Newbie

    Joined:
    Mar 15, 2008
    Messages:
    43
    Likes Received:
    3
    Occupation:
    web programmerr
    Location:
    texas
    I kinda lost you at the end but, this should be more or less what youre looking for.. you may have to play with it i didnt test it.
    Code:
    <?PHP 
    srand((float) microtime() * 10000000);
    $sites=array("something.com","something.com","something.com","sopmething.com");
    $rand_sites = array_rand($sites, 1);
    $referer=$_SERVER['HTTP_REFERER'];
    
    if($referer=='example1.com'){
    
    // this will redirect them to a random site
    // defined in $sites
    header('Location: '.$input[$rand_sites[0]]);
    
    } elseif ($referer!='example1.com'){
    
    
    header('Location: example4iguess.com');
    
    }
    
     
  4. nerdmoney

    nerdmoney Junior Member

    Joined:
    Feb 24, 2008
    Messages:
    135
    Likes Received:
    37
    Occupation:
    web nerd
    do you own example 3 and 4? or are you trying to mask the true refering url?
     
  5. bosshog

    bosshog Newbie

    Joined:
    Mar 15, 2008
    Messages:
    43
    Likes Received:
    3
    Occupation:
    web programmerr
    Location:
    texas
    yeah he kinda lost me
     
  6. Emasters

    Emasters Newbie

    Joined:
    Feb 28, 2008
    Messages:
    43
    Likes Received:
    10
    hey i can help pm me with your aim
     
  7. streetjammer

    streetjammer BANNED BANNED

    Joined:
    Sep 25, 2008
    Messages:
    115
    Likes Received:
    5
    Thanks for sharing the code bosshog :)
    I don't know if it's me but I can't get the script to redirect to: example1.com - its redirecting to example4iguess.com instead??
    nerdmoney - Yes I own example 3 + 4
     
  8. bosshog

    bosshog Newbie

    Joined:
    Mar 15, 2008
    Messages:
    43
    Likes Received:
    3
    Occupation:
    web programmerr
    Location:
    texas
    It redirects to example4 if the referer is not example1
     
  9. bosshog

    bosshog Newbie

    Joined:
    Mar 15, 2008
    Messages:
    43
    Likes Received:
    3
    Occupation:
    web programmerr
    Location:
    texas
    Oh i get it now, you want to set the referers and check them as well + redirect etc?
     
  10. streetjammer

    streetjammer BANNED BANNED

    Joined:
    Sep 25, 2008
    Messages:
    115
    Likes Received:
    5
    Let me try to explain it in a different way.

    If user comes from site "A" the user will be redirected randomly to site(S) "B" (Must be multiple) --> Displaying Site "C" as referer in log files

    If the user don't come from site "A" the user will be redirected randomly to site(S) "D" (Must be multiple) --> Displaying referer(S) in log files randomly (Must be multiple)

    Is it possible to make? Or is it only me that need such strange stuff?
     
  11. streetjammer

    streetjammer BANNED BANNED

    Joined:
    Sep 25, 2008
    Messages:
    115
    Likes Received:
    5
    BTW This forum rocks!
     
  12. bosshog

    bosshog Newbie

    Joined:
    Mar 15, 2008
    Messages:
    43
    Likes Received:
    3
    Occupation:
    web programmerr
    Location:
    texas
    Its possible to write that, but you need to own the domains whos referers you want to use.
     
  13. streetjammer

    streetjammer BANNED BANNED

    Joined:
    Sep 25, 2008
    Messages:
    115
    Likes Received:
    5
    I do own them :D