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

How to prevent loosing the referer after redirect?

Discussion in 'Cloaking and Content Generators' started by hipapatuk, Nov 13, 2008.

  1. hipapatuk

    hipapatuk Newbie

    Joined:
    Feb 15, 2008
    Messages:
    34
    Likes Received:
    4
    Hey buddies,

    im trying like already all day into doing this... but can't and seems impossible. Can someone tell me if it is possible and how can I keep my referer after .htaccess (RewriteRule) or php header redirection? :eek:

    Best,
    h
     
  2. cooooookies

    cooooookies Senior Member

    Joined:
    Oct 6, 2008
    Messages:
    1,008
    Likes Received:
    216
    Search in this category, there is already an excellent thread about that!

    header('Location: bla')

    just as teaser
     
  3. hipapatuk

    hipapatuk Newbie

    Joined:
    Feb 15, 2008
    Messages:
    34
    Likes Received:
    4

    Dude I know that php code and I tried it but it clears the referer. But I want to prevent that. I want to keep my referer. Actually im about to come with a solution, will share it with you guys :rolleyes:
     
  4. zone69

    zone69 Junior Member

    Joined:
    Nov 24, 2008
    Messages:
    196
    Likes Received:
    1,290
    javascript is the most reliable way to pass the referer. Using php or meta refresh will blank the referer most the time except in the Safari browser

    Something like this should pass the referrer without issue.
    Code:
    <script type="text/javascript">
    <!--
    window.location = "http://www.redirect-url.com/"
    //-->
    </script>
    
    Hope that works for you.
     
    • Thanks Thanks x 2
  5. drkenneth

    drkenneth Executive VIP

    Joined:
    Nov 13, 2008
    Messages:
    285
    Likes Received:
    176
    Occupation:
    Developer/Entrepreneur
    Location:
    USA
    Summary of usual behavior:
    -Meta clears the referer
    -Java location gives the the referer of the bouce page (i.e. the page the code is on)
    -PHP Header Redirect gives the referer of the preceding page

    These are all to be taken with a grain of salt, as different browsers can behave differently. (e.g. Safari does not clear on meta refresh)
     
    • Thanks Thanks x 1
  6. fatjack'sblackhat

    fatjack'sblackhat Jr. VIP Jr. VIP Premium Member

    Joined:
    Jul 16, 2008
    Messages:
    611
    Likes Received:
    129
    Occupation:
    college student
    Location:
    Florida
    Great information guys! You know, I havent been in this section of the forums at all yet! There is just sooo much to learn when you start out as a complete n00b with skills only in cs source. But as for the meta refresh, is it possibly to execute a meta refresh on a forum sit that only allows [​IMG]
     
  7. drkenneth

    drkenneth Executive VIP

    Joined:
    Nov 13, 2008
    Messages:
    285
    Likes Received:
    176
    Occupation:
    Developer/Entrepreneur
    Location:
    USA
     
  8. Mrvegas

    Mrvegas Newbie

    Joined:
    Oct 9, 2009
    Messages:
    30
    Likes Received:
    15
    Occupation:
    Design Director
    Location:
    Europe

    Did you find a solution to pass the referer with htaccess?
     
  9. hipapatuk

    hipapatuk Newbie

    Joined:
    Feb 15, 2008
    Messages:
    34
    Likes Received:
    4
    Unfortunately not. The only way to do it is by using javascript redirection. The code is on already posted on BHW.
     
  10. Mrvegas

    Mrvegas Newbie

    Joined:
    Oct 9, 2009
    Messages:
    30
    Likes Received:
    15
    Occupation:
    Design Director
    Location:
    Europe
    I've been reading about a technique where you could pass your referer as querystring attached to your url (with htaccess). then write a script that reads the query.

    if I find out how exactly i'll post it here.. :)
     
  11. hipapatuk

    hipapatuk Newbie

    Joined:
    Feb 15, 2008
    Messages:
    34
    Likes Received:
    4
    Sounds interesting although I'm not quite sure if it's possible.. anyways you can always you js.. although I don't know what your project is :)
    In my project I couldn't use js.. so I gave up after reading the whole htaccess documentation.. :D
    I hope you make it!
     
  12. voidale

    voidale Jr. VIP Jr. VIP Premium Member

    Joined:
    Sep 29, 2008
    Messages:
    583
    Likes Received:
    176
    This code works fine on FF & Chrome but not on IE, Is there a way to pass the ref or fake the ref with a redirect that works on IE too? Any ideas?
    nvm found a way
     
    Last edited: Nov 27, 2010
  13. JerrodMJames

    JerrodMJames Newbie

    Joined:
    Nov 27, 2010
    Messages:
    16
    Likes Received:
    2
    how about coo kie stuffing? does this work?
     
  14. beolion

    beolion Junior Member

    Joined:
    Aug 10, 2010
    Messages:
    113
    Likes Received:
    9
    Server side you can't do much, the referer should be set by the browser.
     
  15. Mrvegas

    Mrvegas Newbie

    Joined:
    Oct 9, 2009
    Messages:
    30
    Likes Received:
    15
    Occupation:
    Design Director
    Location:
    Europe
    with php it works best. referer stays ok.
    <?php header('Location: ... ');/* send to site */ ?>
     
  16. dannyhw

    dannyhw Senior Member

    Joined:
    Jul 16, 2008
    Messages:
    980
    Likes Received:
    462
    Occupation:
    Software Engineer
    Location:
    New York City Burbs
    I've never heard of any type of HTTP header based redirect not passing referrer in any browser. Last I remember a while ago on here I was doing all kinds of research to try to reliably blank the referrer. Even with Flash it passed.