]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
A minor enhancement to SetEnvIf*: allow it to test envariables
authorKen Coar <coar@apache.org>
Fri, 4 Jun 1999 18:40:00 +0000 (18:40 +0000)
committerKen Coar <coar@apache.org>
Fri, 4 Jun 1999 18:40:00 +0000 (18:40 +0000)
as well as request attributes.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@83292 13f79535-47bb-0310-9956-ffa450edef68

docs/manual/mod/mod_setenvif.html

index d3ed345b73397e6fbd7fc24ab4e693537f4799d4..868a1106ae92b902c73dcd09c1d9333210495344 100644 (file)
    HREF="directive-dict.html#Compatibility"
    REL="Help"
   ><STRONG>Compatibility:</STRONG></A> Apache 1.3 and above; the
-  Request_Protocol keyword is only available with 1.3.7 and later
+  Request_Protocol keyword and environment-variable matching are only
+  available with 1.3.7 and later
   </P>
   <P>
   The <SAMP>SetEnvIf</SAMP> directive defines environment variables
   <SAMP>Host</SAMP>, <SAMP>User-Agent</SAMP>, and <SAMP>Referer</SAMP>.
   </P>
   <P>
+  If the <EM>attribute</EM> name doesn't match any of the special keywords,
+  nor any of the request's header field names, it is tested as the name
+  of an environment variable in the list of those associated with the request.
+  This allows <CODE>SetEnvIf</CODE> directives to test against the result
+  of prior matches.
+  </P>
+  <BLOCKQUOTE>
+   <STRONG>Only those environment variables defined by earlier
+   <CODE>SetEnvIf[NoCase]</CODE> directives are available for testing in
+   this manner.  'Earlier' means that they were defined at a broader scope
+   (such as server-wide) or previously in the current directive's
+   scope.</STRONG>
+  </BLOCKQUOTE>
+  <P>
   Example:
   </P>
   <PRE>
-   SetEnvIf Request_URI "\.(gif)|(jpg)|(xbm)$" object_is_image
+   SetEnvIf Request_URI "\.gif$" object_is_image=gif
+   SetEnvIf Request_URI "\.jpg$" object_is_image=jpg
+   SetEnvIf Request_URI "\.xbm$" object_is_image=xbm
+        :
    SetEnvIf Referer www\.mydomain\.com intra_site_referral
+        :
+   SetEnvIf object_is_image xbm XBIT_PROCESSING=1
   </PRE>
   <P>
-  The first will set the envariable <SAMP>object_is_image</SAMP> if the
-  request was for an image file, and the second sets
+  The first three will set the envariable <SAMP>object_is_image</SAMP> if the
+  request was for an image file, and the fourth sets
   <SAMP>intra_site_referral</SAMP> if the referring page was somewhere
   on the <SAMP>www.mydomain.com</SAMP> Web site.
   </P>