0

I have two servers A and B. User accesses some page on server A and server A sends redirection (302 status code) and returns. now client sends the request to server B. So now what I want is some way to find the ip address of the server A from this request, any identity of server A will do the work, $_SERVER['HTTP_REFERER'] is coming blank.

PS: I have control on Server B only not on A. Also if I access the page of server A directly (which is sending redirect to Server B) I am getting blank referer at server B.

Thanks in advance

codeomnitrix
  • 4,179
  • 19
  • 66
  • 102
  • possible duplicate of [Will a 302 redirect maintain the referer string?](http://stackoverflow.com/questions/2158283/will-a-302-redirect-maintain-the-referer-string) – Mike Jun 19 '15 at 19:12
  • modified the question, please check – codeomnitrix Jun 19 '15 at 19:26
  • You didn't really modify it. Anyway, as you'll see in the answers to the question above, you can't get the hostname (or IP) of the server issuing a 301/302 redirect. The only information you get is what's in `$_SERVER`, unless you can get the other server to append its hostname to the query string. – Mike Jun 19 '15 at 19:47
  • I'm pretty sure @Mike is right. When following a redirect, there's nothing that indicates the page that sent the redirect. – Barmar Jun 19 '15 at 20:24
  • @Mike It doesn't seem to be a duplicate of that. He's not interested in the original `Referer`, he wants a new parameter that contains the intermediate URL. – Barmar Jun 19 '15 at 20:37
  • @Barmar You're right. My mistake. – Mike Jun 19 '15 at 21:01
  • Thanks guys, however I was pretty surprised why referer wasn't sent? – codeomnitrix Jun 20 '15 at 02:58

1 Answers1

0

You cannot get the IP of the referrer (i.e. the server that initiated the redirect to your server).

codersofthedark
  • 9,183
  • 8
  • 45
  • 70