Changing the value of referrer [duplicate]
This question already has answers here : Closed 6 years ago . Possible Duplicate: How to manually set REFERER header in Javascript? How to change the value of document.referrer ? I tried this <body> <center><a href="test.php" target="_self">self</a></center> <script type="text/javascript"> alert( document.referrer); document.referrer="test"; alert( document.referrer); </script> </body> It is not working, any ideas? You can't modify the referrer directly, but you can use history.pushState() / history.replaceState() to push a new URL into the browser history (provided the URL you want to push