on the SetEnvIf (and SetEnvIfNoCase) directive attribute field.
Example: SetEnvIf ^TS* [a-z].* HAVE_TS
will cause HAVE_TS to be set if any of the request headers begins
with "TS" and has a value that begins with any character in the
set [a-z]. [Bill Stoddard]
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89353
13f79535-47bb-0310-9956-
ffa450edef68
Changes with Apache 2.0.19-dev
+ *) Extend mod_setenvif to support specifying regular expressions
+ on the SetEnvIf (and SetEnvIfNoCase) directive attribute field.
+ Example: SetEnvIf ^TS* [a-z].* HAVE_TS
+ will cause HAVE_TS to be set if any of the request headers begins
+ with "TS" and has a value that begins with any character in the
+ set [a-z]. [Bill Stoddard]
+
*) httpd children now re-bind themselves to a random CPU on
multiprocessor systems on AIX via bindprocessor() in 2.0.
[Victor J. Orlikowski]
scope.</STRONG>
</BLOCKQUOTE>
<P>
+ <EM>attribute</EM> may be a regular expression when used to match a request header.
+ If <EM>attribute</EM> is a regular expression and it doesn't match any of the
+ request's header names, then <EM>attribute</EM> is not tested against the request's
+ environment variable list.
+ </P>
+ <P>
Example:
</P>
<PRE>
SetEnvIf Referer www\.mydomain\.com intra_site_referral
:
SetEnvIf object_is_image xbm XBIT_PROCESSING=1
+ :
+ SetEnvIf ^TS* ^[a-z].* HAVE_TS
</PRE>
<P>
The first three will set the environment variable <SAMP>object_is_image</SAMP> if the
<SAMP>intra_site_referral</SAMP> if the referring page was somewhere
on the <SAMP>www.mydomain.com</SAMP> Web site.
</P>
-
+ <P>
+ The last example will set environment variable <SAMP>HAVE_TS</SAMP> if the request
+ contains any headers that begin with "TS" whose values begins with any character
+ in the set [a-z].
+ </P>
<HR> <!-- the HR is part of the directive description -->
<H2>
<A NAME="SetEnvIfNoCase">SetEnvIfNoCase directive
* SetEnvIf name regex var ...
*
* where name is either a HTTP request header name, or one of the
- * special values (see below). The 'value' of the header (or the
- * value of the special value from below) are compared against the
- * regex argument. If this is a simple string, a simple sub-string
+ * special values (see below). 'name' may be a regex when it is used
+ * to specify an HTTP request header name. The 'value' of the header
+ & (or the value of the special value from below) are compared against
+ * the regex argument. If this is a simple string, a simple sub-string
* match is performed. Otherwise, a request expression match is
* done. If the value matches the string or regular expression, the
* environment variables listed as var ... are set. Each var can
* This could be written as:
*
* SetEnvIf remote_addr (127.0.0.1|192.168.10.) LOCAL
+ *
+ * To set HAVE_TS if the client request contains any header beginning
+ * with "TS" with a value beginning with a lower case alphabet:
+ *
+ * SetEnvIf ^TS* ^[a-z].* HAVE_TS
*/
#include "apr.h"