Tes" /> Tes" /> Tes"/>

How to Avoid forwarding referrer value using PHP

37 views Asked by At

Example.com/redirect.php --> Have the header("Location: https://stackoverflow.com");

Test.com --> <a href="https://www.example.com/redirect.php" > Test Click </a>

Now, redirect will perform like this

Test.com (Link clicked) -> Example.com/redirect.php -> https://stackoverflow.com

When i check referrer value at final destination (Stackoverflow.com) then it showing test.com as referrer instead of example.com.

So, referrer value are forwarding from Test.com to Stackoverflow.com. How to avoid this?. How to make sure stackoverflow.com get the referrer of only previous domain?

PHP Code

//header("Referrer-Policy: no-referrer");
header("Location: https://stackoverflow.com", true, 301);
0

There are 0 answers