0

how to identify a request( by http redirect ) is from local site or other sites?

such as, i have a site: www.my.com

and www.my.com/a.html will redirect to www.my.com/b.html

other sites will redirect to www.my.com/b.html

how can i identify where the redirect from?

HTTP Referrer may be unbelievable

stutiredboy
  • 347
  • 1
  • 2
  • 12

1 Answers1

0

Server-side you could track IP addresses and match these across requests.

But personally I'd go for the simpler Referrer solution.

See HTTP Referrer Gotchas? for further discussion on this.

Another option you have if you're using dynamic content generation (eg ASP, PHP, etc) is to use URL rewriting rather than redirecting via the client. In this case, the client still thinks they're requesting www.my.com/a but you return the content for www.my.com/b In the code which generates b you can see that the request is for www.my.com/a so you know that they've been "rewritten".

Community
  • 1
  • 1
Colin 't Hart
  • 7,372
  • 3
  • 28
  • 51