I would like to set some response headers condtionally based on the
of a specific request header.
From Apache docs
"Conditionally send MyHeader on the response if and only if header
"MyRequestHeader" is present on the request. This is useful for
constructing headers in response to some client stimulus. Note that
this example requires the services of the mod_setenvif module.
SetEnvIf MyRequestHeader value HAVE_MyRequestHeader
Header add MyHeader "%D %t mytext" env=HAVE_MyRequestHeader
If the header "MyRequestHeader: value" is present on the HTTP request,
the response will contain the following header:
MyHeader: D=3775428 t=991424704447256 mytext
I am using apache-2_0_16 (tried with earlier versions too). I cannot
get it to work
as defined in the documents. I get the following error :
Header takes two or three arguments, an action, header and value
on apachect start. Here is the snippet from my logfile :
SetEnvIf MyReqHeader \.* resp_hdr1
Header set Cache-Control "no-cache" env=resp_hdr1
Does this work ? If so, what am I doing wrong ?
Any help would be appreciated.