Home > Software design >  Referrer-Policy with PHP and htaccess
Referrer-Policy with PHP and htaccess

Time:01-05

is there any way to overwrite the header referrer policy using htaccess or PHP?

HTML Code :

<meta name="referrer" content="origin">

Is any way to do same with htaccess or PHP? i tried these code from How to set Firefox referrer to "no-referrer" using PHP Referrer-Policy?

I tried (PHP) :

header("Referrer-Policy: origin");

With Htaccess :

<IfModule mod_headers.c>
    Header set Referrer-Policy "origin"
</IfModule>

Still it not overriding strict-origin-when-cross-origin.

Firefox info : https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy

CodePudding user response:

I tried in private browser and it worked !!

<IfModule mod_headers.c>
    Header set Referrer-Policy "origin"
</IfModule>
  •  Tags:  
  • Related