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

PHP Redirect + Keep Referrer..??

Discussion in 'Cloaking and Content Generators' started by x5g7j9l3x, Sep 22, 2009.

  1. x5g7j9l3x

    x5g7j9l3x Junior Member

    Joined:
    Feb 20, 2009
    Messages:
    127
    Likes Received:
    1
    Code:
    <?php
    $URL = $_SERVER['QUERY_STRING'];
    header("Location: $URL");
    ?>
    That PHP code will redirect you to whatever URL you put after the ? ['QUERY_STRING'] in yer URL string..

    So when you directly visit "http://my-site.com/?http://stardrifter.org/cgi-bin/ref.cgi" by pasting it in yer browsers URL & hitting GO
    it will redirect to "http://stardrifter.org/cgi-bin/ref.cgi"
    which is a site that tells you yer referrer..

    But when you directly visit "http://my-site.com/?http://stardrifter.org/cgi-bin/ref.cgi"
    NO REFERRER IS DISPLAYED at "http://stardrifter.org/cgi-bin/ref.cgi"..!!!

    The Function "header("Location: $URL");" strips out the referrer..

    How can I make the referrer either display as "http://my-site.com/?http://stardrifter.org/cgi-bin/ref.cgi" or the root of the site that it gets redirected to "http://stardrifter.org"..??
     
  2. lucius

    lucius Power Member

    Joined:
    Jul 29, 2009
    Messages:
    546
    Likes Received:
    158
  3. popzzz

    popzzz Supreme Member

    Joined:
    Apr 12, 2009
    Messages:
    1,337
    Likes Received:
    13,701
    Location:
    Don't touch the REP!
    .
    Just use:
    Code:
    <?php
    header("Location: http://stardrifter.org/cgi-bin/ref.cgi");
    exit;
    ?>


    HTH .... :cool2:
     
  4. BozoClown

    BozoClown Junior Member

    Joined:
    Jan 4, 2009
    Messages:
    150
    Likes Received:
    106
    I think you are wrong. That header redirect does not strip the referer.

    google.com?q=keyword -> .php file with header("Location:$url) -> domain.php


    At domain.php the referer will be google.com?q=keyword

    You either haven't fully disclosed what you are doing or your browser settings are at fault, but your redirection as you have stated should not strip the referer.
     
  5. x5g7j9l3x

    x5g7j9l3x Junior Member

    Joined:
    Feb 20, 2009
    Messages:
    127
    Likes Received:
    1
    are you clicking a link that goes to php file with header("Location:$url)
    if you are then it will show referrer as google.com?q=keyword
    but if you do like i say in my 1st post by directly visit "http://my-site.com/?http://stardrifter.org/cgi-bin/ref.cgi" by pasting it in yer browsers URL & hitting GO
    Now tell me what referrer it shows for you..??
    Note... http://my-site.com/? is not a real site.. it is meant for your actual site..
    test please an let me know what the page "http://stardrifter.org/cgi-bin/ref.cgi" says is yer referrer..??
     
  6. popzzz

    popzzz Supreme Member

    Joined:
    Apr 12, 2009
    Messages:
    1,337
    Likes Received:
    13,701
    Location:
    Don't touch the REP!


    I don't understand WTF you are asking??? ..... :wt:

    If you put your string in the address bar and hit enter it goes to whatever domain you entered to the left of the ? and NOT to

    Code:
    http://stardrifter.org/cgi-bin/ref.cgi
    In my particular case on several of my domains it goes to a forbidden page:
    Forbidden You don't have permission to access / on this server.
    because you can't do it for security reasons .....

    HTH .... :cool2:

     
    Last edited: Sep 22, 2009