From 1c109a844ae782a7a33c0ff623d1982bba2219f0 Mon Sep 17 00:00:00 2001 From: Ken Coar Date: Fri, 4 Jun 1999 18:40:00 +0000 Subject: [PATCH] A minor enhancement to SetEnvIf*: allow it to test envariables 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 | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/docs/manual/mod/mod_setenvif.html b/docs/manual/mod/mod_setenvif.html index d3ed345b733..868a1106ae9 100644 --- a/docs/manual/mod/mod_setenvif.html +++ b/docs/manual/mod/mod_setenvif.html @@ -261,7 +261,8 @@ HREF="directive-dict.html#Compatibility" REL="Help" >Compatibility: 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

The SetEnvIf directive defines environment variables @@ -299,15 +300,34 @@ Host, User-Agent, and Referer.

+ If the attribute 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 SetEnvIf directives to test against the result + of prior matches. +

+
+ Only those environment variables defined by earlier + SetEnvIf[NoCase] 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. +
+

Example:

-   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
   

- The first will set the envariable object_is_image if the - request was for an image file, and the second sets + The first three will set the envariable object_is_image if the + request was for an image file, and the fourth sets intra_site_referral if the referring page was somewhere on the www.mydomain.com Web site.

-- 2.47.2