SitePoint Sponsor

User Tag List

Results 1 to 12 of 12
  1. #1
    SitePoint Enthusiast
    Join Date
    Jun 2009
    Posts
    55
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Redirect script that blanks referrer?

    Hi,

    Is it possible to use a re-direct script to blank the referral domain? I've heard of things like this but haven't actually seen it done.

  2. #2
    SitePoint Wizard PHPycho's Avatar
    Join Date
    Dec 2005
    Posts
    1,200
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Delta223 View Post
    Hi,

    Is it possible to use a re-direct script to blank the referral domain? I've heard of things like this but haven't actually seen it done.
    Can you elaborate some more. It just passed out of my head.

  3. #3
    SitePoint Enthusiast
    Join Date
    Jun 2009
    Posts
    55
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, I'm just looking for a php script that will send the visitor to another page but remove any referral details.

  4. #4
    SitePoint Wizard PHPycho's Avatar
    Join Date
    Dec 2005
    Posts
    1,200
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Delta223 View Post
    Yes, I'm just looking for a php script that will send the visitor to another page but remove any referral details.
    I think your problem is incomplete.
    If you meant just redirection then are many ways:
    PHP: header('Location: redirect_url.php');
    HTML: <meta http-equiv="refresh" content="0;url=redirect_url.php" />
    Javascript: window.location='redirect_url.php'

  5. #5
    SitePoint Guru Ruben K.'s Avatar
    Join Date
    Jun 2005
    Location
    Alkmaar, The Netherlands
    Posts
    693
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is not possible without FireFox's Spoof plugin

  6. #6
    SitePoint Wizard silver trophy kyberfabrikken's Avatar
    Join Date
    Jun 2004
    Location
    Copenhagen, Denmark
    Posts
    6,157
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Currently, that' a property of the browser. Eg. a user can configure her browser to not send the referrer along. Some cutting edge browsers has a property that allows you to control it for the user, but it's not widely supported:

    http://webkit.org/blog/907/webkit-ni...link-relation/

  7. #7
    Non-Member
    Join Date
    Oct 2009
    Posts
    1,852
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've heard that some javascript trick can do the thing
    Anyway there is noway with PHP. Because - it is very important to understand - it is not PHP who requests another page, but browser.

  8. #8
    SitePoint Guru Ruben K.'s Avatar
    Join Date
    Jun 2005
    Location
    Alkmaar, The Netherlands
    Posts
    693
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Shrapnel_N5 View Post
    I've heard that some javascript trick can do the thing
    Anyway there is noway with PHP. Because - it is very important to understand - it is not PHP who requests another page, but browser.
    I believe javascript's document.location also fills the referer header in the browser, though

  9. #9
    SitePoint Wizard
    Join Date
    Nov 2005
    Posts
    1,191
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Would be up to the browser in either case as far as I understand things.

    @OP, why do you want to do this????

  10. #10
    SitePoint Guru Ruben K.'s Avatar
    Join Date
    Jun 2005
    Location
    Alkmaar, The Netherlands
    Posts
    693
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by hash View Post
    Would be up to the browser in either case as far as I understand things.

    @OP, why do you want to do this????
    Perhaps to hide where the visit came from, when linking/redirecting to another site? (for what-ever reasons)

  11. #11
    SitePoint Enthusiast
    Join Date
    Jun 2009
    Posts
    55
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Ruben K. View Post
    Perhaps to hide where the visit came from, when linking/redirecting to another site? (for what-ever reasons)
    Yes precisely. It doesn't have to be in PHP, but adding javascript code to the page could complicate things a great deal. But if its possible to do that way then it would be worth it.

    Do url redirect sites like tinyurl change the redirection site to become the new referrer?

  12. #12
    SitePoint Wizard silver trophy kyberfabrikken's Avatar
    Join Date
    Jun 2004
    Location
    Copenhagen, Denmark
    Posts
    6,157
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Delta223 View Post
    Do url redirect sites like tinyurl change the redirection site to become the new referrer?
    No, if they use a http-redirect, the original site will be in the referrer header.

    I think you could serve your site through https. I'm pretty sure that the origin will be hidden when going from http to http. I'm not entirely sure though, so you should probably double check that it works.


Bookmarks

Posting Permissions

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