1

Is there a cross-browser way to call Javascript setLocation() but still to keep the referrer to the one that lead to the current webpage (just like in HTTP server-side redirect) and if yes then how?

Clarifying example:

Site A sent a user to Site B.

When arriving on Site B, Site A is the referrer. When redirecting from Site B to Site C (by adjusting the location in JS), Site B will be referrer. I'd like to keep the original referrer (i.e. Site A) when redirecting from B to C.

BreakPhreak
  • 10,940
  • 26
  • 72
  • 108
  • It must be already set, just like if you would click on a link. [javascript - Is the REFERER set if you redirect to a new web page using location.href =? - Stack Overflow][1] [1]: http://stackoverflow.com/questions/5657558/is-the-referer-set-if-you-redirect-to-a-new-web-page-using-location-href – Oskars Pakers Apr 22 '14 at 14:01
  • added an example to clarify the question – BreakPhreak Apr 22 '14 at 14:52

1 Answers1

0

It is seems like you need a referrer history persistence, you can use query-string to achieve it easily:

www.c.com/?originalReferrer=A
Yair Nevet
  • 12,725
  • 14
  • 66
  • 108