views:

37

answers:

4

I need to do redirect my site visitors to a third party site, without the original referrer showing as the urls disclose private information.

Is there a way to instruct a browser redirection without a referrer being sent to the destination site? E.g. using javascript?

Thanks

A: 

You will need to redirect through another page. You can do a POST to your own page which then does a redirect to the destination. This will show only your intermediate page as the referrer.

There is not a way to do this with just javascript.

Alan Geleynse
+2  A: 

As a quick workaround, you could redirect them to a special URL owned by you which exclusively redirects to the target URL (or one provided as a query parameter, for example). This way the private information would be lost in the extra hop.

maerics
when I do this with e.g. a tinyurl redirection, the original referrer still shows when loading the final destination page.
Gj
Right, you'll have to setup your own HTTP request handler which simply responds "302 Found" with a Location header as your redirect URL and ideally overwriting the Referer header, in case your webserver or container copies that header automatically for 302 responses.
maerics
A: 

Have you tried

<meta http-equiv="refresh" content="0;url=http://www.someplace.com"&gt;
Faheem
this still results with the original url sent as the referrer
Gj
A: 

Try redirect with curl for example.

bswietochowski