homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

How to redirect & not pass referrer information?

 7:15 pm on Mar 20, 2007 (gmt 0)

What is the best way (with Apache) to redirect a URL and not pass along any of the referring information?

I need to redirect a page to a partner website, but I don't want to give them any stats/referrer information. I tried a 302 redirect, but it seems to still pass along the information. Any tips?



 7:25 pm on Mar 20, 2007 (gmt 0)

The HTTP_REFERRER is part of the client browser request, and is therefore not under your control. The decision to pass or not pass a referrer rests with the user.



 8:05 pm on Mar 20, 2007 (gmt 0)

You are suggesting that I can't set-up a redirect where the partner website I'm sending the traffic would only see the redirect as the source?

For example... domain.com/redirect/

All I want them to see is the redirect URL domain.com/redirect/ - not which page etc.. it came from on my website. Basically...I just don't want to give them a bunch of data they could use for their benefit.


 1:55 am on Mar 21, 2007 (gmt 0)

A redirect tells the client (browser), "That content has moved, ask for it at this new URL" and provides the new URL. The client then re-requests the originally-desired content from that new URL, and (unless the user has taken steps to prevent it) provides the same referrer as with the original request.

So, I'm not suggesting anything, I'm stating a fact... Redirects don't "hide" a referrer.



 2:57 am on Mar 21, 2007 (gmt 0)

Maybe if you redirect them to a real page on your server and use a META HTTP-EQUIV REFRESH... tag (with a content > 0) on that page to redirect, the browser may change it's referral info to the page URL that contains the META tag, but HTTP redirects given by a Location: header only tell the browser to resubmit the entire request (headers and POST data) to the new location.

note: bots typically ignore META REFRESH tags.

You can't modify it either since the browser supplies it -- to do that, you would have to proxy the request, ie: make the request yourself on behalf of the initial browser (setting your own referral tag), and then return the response.


 10:06 pm on Mar 21, 2007 (gmt 0)

thanks for the info.

i could possibly do a meta refresh because in this instance i don't need bots to follow it...but aren't meta refreshes kind of shady?


 10:14 pm on Mar 21, 2007 (gmt 0)

META REFRESH - Probably no more shady than trying to tweak a referrer :)

It's a client-side redirect, 'tis all -- It carries a similar risk factor as client-side JavaScript, and as such, may be blocked (ignored) by the client's popup blocking logic.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved