Sign up ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

Is there a way in which I can find out if a user arrived at my site via a redirect?

Here's an example: There are two sites, & Any request to will do a 302 redirect to When the request at arrives, is there anyway to know it was redirected from

Note that in this example you have no control over (In fact, it could be something bad, like

Also note, because it is a redirect, it will not be in the HTTP referrer header.

share|improve this question

migrated from Feb 11 '11 at 23:40

This question came from our site for power users of web applications.

Google Analytics will do this for you. Are you looking to write your own JavaScript code to do this? If you are then this question should be migrated to Stack Overflow. Let me know if this is the case and I will migrate it for you. – Barry Feb 10 '11 at 8:24

1 Answer 1


  • you have no control over; and
  • the 302 means the HTTP Referer header is blank; then

no, there's no way for to know you're coming from a redirect.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.