From: Igor Galić Date: Sat, 20 Nov 2010 21:47:53 +0000 (+0000) Subject: Adding SetEnvIfExpr documentation, and more references to expr.html X-Git-Tag: 2.3.9~16 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2faa163a27b299a52333249e49983b6385ff4faf;p=apache Adding SetEnvIfExpr documentation, and more references to expr.html git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1037339 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/docs/manual/expr.xml b/docs/manual/expr.xml index b3ef8e9305..4a86f5acc6 100644 --- a/docs/manual/expr.xml +++ b/docs/manual/expr.xml @@ -22,7 +22,7 @@ - Expressions in Apache + Expressions in Apache HTTP Server

Historically, there are several syntax variants for expressions used to express @@ -299,7 +299,7 @@ listfunction ::= listfuncname "(" word ")" note Lookup request environment variable env - Reqturn first match of note, reqenv, + Return first match of note, reqenv, osenv tolower Convert string to lower case diff --git a/docs/manual/mod/core.xml b/docs/manual/mod/core.xml index 57838f24cb..33a955bc86 100644 --- a/docs/manual/mod/core.xml +++ b/docs/manual/mod/core.xml @@ -1594,6 +1594,8 @@ satisfied by a request at runtime +Expressions in Apache HTTP Server, +for a complete reference and more examples. How <Directory>, <Location>, <Files> sections work for an explanation of how these different sections are combined when a request is received. diff --git a/docs/manual/mod/mod_filter.xml b/docs/manual/mod/mod_filter.xml index 2a9880d79d..9e6ccf46b9 100644 --- a/docs/manual/mod/mod_filter.xml +++ b/docs/manual/mod/mod_filter.xml @@ -359,10 +359,13 @@ ap_register_output_filter.

-

expression is described in the +

expression is an ap_expr documentation.

+Expressions in Apache HTTP Server, +for a complete reference and examples. +mod_include diff --git a/docs/manual/mod/mod_include.xml b/docs/manual/mod/mod_include.xml index f843718a77..c817ae7b6f 100644 --- a/docs/manual/mod/mod_include.xml +++ b/docs/manual/mod/mod_include.xml @@ -712,6 +712,11 @@

All slashes which are not intended to act as delimiters in your regex must be escaped. This is regardless of their meaning to the regex engine.

+ + Reference Documentation +

See also: Expressions in Apache HTTP Server, + for a complete reference and examples.

+
diff --git a/docs/manual/mod/mod_setenvif.xml b/docs/manual/mod/mod_setenvif.xml index 6c0c92a9d9..ef639a0a2c 100644 --- a/docs/manual/mod/mod_setenvif.xml +++ b/docs/manual/mod/mod_setenvif.xml @@ -254,6 +254,49 @@ for additional examples. + + + +SetEnvIfExpr +Sets environment variables based on an expression +SetEnvIfExpr expr + [!]env-variable[=value] + [[!]env-variable[=value]] ... +server config +virtual hostdirectory +.htaccess +FileInfo + + +

The SetEnvIfExpr directive defines + environment variables based on an If + ap_expr. These expressions will be evaluated at runtime, + and applied env-variable in the same fashion as SetEnvIf.

+ + + SetEnvIfExpr "tolower(%req['X-Sendfile']) = 'D:\images\very_big.iso')" iso_delivered + + +

This would set the environment variable iso_delivered + every time our application attempts to send it via X-Sendfile

+ +

For a more useful example, consider the Referer + example from above for a site with more than one domain:

+ + + SetEnvIfExpr "${HTTP_REFERER} in www.example.com,example.com,w2.example3.org" intra_site_referral + +
+ +Expressions in Apache HTTP Server, +for a complete reference and more examples. +If can be used to achive similar +results. +mod_filter +mod_include> +
+ SetEnvIfNoCase Sets environment variables based on attributes of the request