I have a domain lets say www.example.com
which I am redirecting to www.whatismyreferer.com
to check referer. When I redirect the page using PHP headers it shows No referer / hidden in result. I want to set referer as www.example.com
on whatismyrefer.com
.
Here is my code on the index.php
file of www.example.com
:
<?php
header("Referrer-Policy: origin");
header("Location: https://www.whatismyreferer.com",true, 302);
?>
I have also tried referrer-policy: unsafe-url
but it still gets no referer
But if I use:
<meta name="referrer" content="origin">
<meta http-equiv="refresh" content="0;https://www.whatismyreferer.com">
then it shows the referrer. I don't want to do it with meta tags, I want to do it with header location
.