Get origin url of 301/302 Forward in PHP/Javascript

257 Views Asked by At

I have a small question: from different domains, I'm forwarding via 301/302 to one distinct target domain.

On the target Server I have a running apache.

I need to know the origin Domain - so from which "source"-domain was the user forwarded to the target domain?!

Is this possible to achieve in PHP / Javascript?

Thanks in advance for your help and greetings from Germany

1

There are 1 best solutions below

0
the.bastian On

Just add a URL Parameter in the redirection, e.g. [..].de/?h=origindomain.

Then you are able to readout the parameter with $_GET["h"].