Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Javascript: Hiding referrer form other servers?

Javascript: Hiding referrer form other servers?
Thread Tools
Mac Elite
Join Date: Jan 2001
Status: Offline
Reply With Quote
Nov 26, 2005, 07:44 PM
 
Hi,

I am trying to link to some other webservers, and do not want them knowing that the users are coming from my site to theirs. Anyone have a good JS hack to do this? Opening a new window and going to the link does not do the trick.

Thanks!
     
Forum Regular
Join Date: Nov 2001
Location: Toronto Canada
Status: Offline
Reply With Quote
Nov 26, 2005, 08:32 PM
 
I suspect that isn't possible, since it defeats the whole purpose of referrers. However, you can use a proxy of some sort. Eg I don't really recommend doing this, but you can piggy-back on someone else's redirect, eg http://go.fark.com/cgi/fark/go.pl?ID...www.google.com

substitute anything you like for www.google.com. You have to escape special characters like backslash and ampersand. and delete the space that macnn.com added after www.goo if you're copying the text link.

The above will register on fark's servers, but on google's servers the referrer will appear as fark.
     
timmerk  (op)
Mac Elite
Join Date: Jan 2001
Status: Offline
Reply With Quote
Nov 26, 2005, 09:08 PM
 
I like your thinking! ;-)

How would I do the same thing that the script does in php? Just do a location header with the url?

That way, I could put it on my school's servers, and have it look like it's coming from there.

Thanks!
     
Forum Regular
Join Date: Nov 2001
Location: Toronto Canada
Status: Offline
Reply With Quote
Nov 27, 2005, 08:17 PM
 
I guess you have the right idea. I don't know much about php. You could also do it with a meta redirect.
     
Clinically Insane
Join Date: Nov 1999
Status: Offline
Reply With Quote
Nov 28, 2005, 09:46 AM
 
The Referer header is sent at a browser level, but it's an important part of the HTTP standard, and it's not something that JavaScript is allowed to mess with. If it were, the security implications would be enormous. As others have said, you'd be better off using a redirector script, but keep in mind that this will need to be hosted on a different site if you want to mask your "real" site's location.

Out of curiosity, why are you trying to mask the Referer header, anyway? Are you worried about other sites banning deep-linking from your site?
You are in Soviet Russia. It is dark. Grue is likely to be eaten by YOU!
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 07:44 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2