Search code examples
httpreferer

Can user request's "Referer" be modified just in server side?


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 :)


Solution

  • 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.