2

Is there a way in php to set the value for the Referrer header that gets sent along with the HTTP request ?

are Understanding Browser this header? for example replace:

< meta http-equiv="Referrer" content="never"/ >

by

header('Referrer: never');//sent header in php
1
  • 2
    Can you explain your actual problem? Commented Jan 8, 2013 at 6:35

2 Answers 2

1

If you are making the HTTP request from PHP (e.g. with cURL), yes.

You can't control the referer header that a browser will make though.

<meta http-equiv="Referrer" content="never" />

Meta http equiv allows you to set something that is (theoretically) equivalent to an HTTP Response header. Referer is a Request header so that won't do anything.

Sign up to request clarification or add additional context in comments.

4 Comments

What would you expect Google to do with it?
@saeedarabsheybani — (a) Note that that is a proposal, not a standard, not something that should be supported by anything, anywhere (b) What do you expect Google to do with it even if anything supported it?
google use this meta to sending/not sending q value (in get param) in referer
@saeedarabsheybani — http-equiv is a joke. You can't substitute HTTP headers and meta http-equiv and expect it to work. If you want to manage it server side, then manage when the meta gets injected into the template or not, not the HTTP headers.
0

You have typed it wrong. It must be "Referer". Yes, normally this is the wrong one though, it is defined like this.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.