httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruno Tréguier <>
Subject Re: [users@httpd] RequestHeader, SetEnvIf: Setting a missing RequestHeader
Date Fri, 30 Mar 2012 12:48:50 GMT
Le 30/03/2012 14:16, Rudolf Bargholz a écrit :

> Goal: to automatically set the SOAPAction if empty or missing.
> Here what I would expect to work, but does not.
> <Files "nph-owscgi.exe">
> SetEnvIf SOAPAction ^h.*$ HAVE_SOAPAction
> RequestHeader set SOAPAction "" env=!HAVE_SOAPAction
> </Files>
> What I am trying to tell Apache is, if the SOAPAction RequestHeader
> starts with an “h”, then set the environment variable HAVE_SOAPAction.
> If the environment variable HAVE_SOAPAction is not set, then set the
> SOAPAction ReqeustHeader to the default value of "".
> Tried other
> Unfortunately this is not working. The SOAPAction is always being
> overwritten, not just if empty or missing from the request headers.
> Any tips what I am doing wrong?

Hi Rudolf,

AFAIK, SetEnvIf's first argument is supposed to be a standard header 
name (listed in RFC2616) or an environment variable. I'm wondering 
whether your SOAPAction custom header is really taken into account as an 
environment variable. It seems that it's not the case, so maybe you 
could try to set an environment variable based on your header, by using 
a side effect of a RewriteRule ("E" flag) and then using that variable 
in your test ?

Here is how I would do that:

RewriteEngine on
RewriteRule .* - [E=SOAPAction:%{HTTP:SOAPAction}]

Then you might be able to use the SOAPAction *environment variable* 
which will have the same value as the SOAPAction *HTTP header*

Could you try that ?

Best regards,


- Service Hydrographique et Oceanographique de la Marine  -  DMGS/INF
-  13, rue du Chatellier -  CS 92803  - 29228 Brest Cedex 2, FRANCE
-     Phone: +33 2 98 22 17 49  -  Email:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message