tags:

views:

143

answers:

3

I have a web site server which do such work like this:

The server receives request from user A(request referer is blank) and then redirect(at server side) user A to visiting web site B;

Is there any way I could modify user A's request referer to my domain name, then site B can get my domain name from user A's request?

Thanks in advance!


Because the web site B (my customer) want to know how many visits I have brought to him; I don't want to modify my client software and want to know if there's another can get this :)

A: 

Only via a client-side (e.g. JavaScript) redirect as far as I know. The kind of thing you just have to try it and see.

Lee Kowalkowski
A: 

As far as I know, the browser automatically sets the referrer unless the user disabled that behaviour. So: no, you can't change it server-side.

Because the web site B (my customer) want to know how many visits I have brought to him; I don't want to modify my client software and want to know if there's another can get this :)

You could append a unique identifier to the URL so that your customer can track who is coming from your site:

http://www.yourcustomer.com/page.html?ref=bluesea007

Actually, Google Analytics makes use of this principle.

middus
+1  A: 

No, a redirect is just telling the client to use a different URL to complete the request. But the actual request to the new URL is done by the client, not the server. And the Referer header field is only set when the client followed an URL on a non-HTTP way (link click, form submission, “meta redirect”, etc.).

Gumbo