From: Stefan Fritsch Date: Sun, 19 Dec 2010 22:35:02 +0000 (+0000) Subject: a bit more documentation for ap_expr's variables X-Git-Tag: 2.3.11~363 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=734e24b274e7e7f8eb1849a505a726cd570a1abc;p=thirdparty%2Fapache%2Fhttpd.git a bit more documentation for ap_expr's variables git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1050955 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/docs/manual/expr.html.en b/docs/manual/expr.html.en index 4a6aeaa330b..e6e9ccffa5c 100644 --- a/docs/manual/expr.html.en +++ b/docs/manual/expr.html.en @@ -108,9 +108,17 @@ listfunction ::= listfuncname "(" word ")"

Variables

-

XXX: not all vars are available in all request phases

- -

Request headers (XXX:see req function)

+ +

The expression parser provides a number of variables of the form + %{HTTP_HOST}. Note that the value of a variable may depend + on the phase of the request processing in which it is evaluated. For + example, an expression used in an <If > + directive is evaluated before authentication is done. Therefore, + %{REMOTE_USER} will not be set in this case.

+ +

The following variables provide the values of the named HTTP request + headers. The values of other headers can be obtained witht the + req function.

@@ -125,82 +133,93 @@ listfunction ::= listfuncname "(" word ")"
Name
HTTP_ACCEPT
- + - + - + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + - + - - - - - - - - - + + + + + - + - + - + - +
NameDescription
REQUEST_METHOD
The HTTP method of the incoming request
REQUEST_SCHEME
The scheme part of the request's URI
REQUEST_URI
The URI of the request
REQUEST_FILENAME
SCRIPT_FILENAMESame as REQUEST_FILENAME
PATH_INFO
QUERY_STRINGThe query string of the current request
IS_SUBREQ"true" if the current request is a subrequest, + "false" otherwise
THE_REQUESTThe complete request line (e.g., + "GET /index.html HTTP/1.1")
REMOTE_ADDRThe IP address of the remote host
REMOTE_HOST
REMOTE_IDENT
REMOTE_USER
SERVER_ADMIN
SERVER_NAME
SERVER_PORT
SERVER_PROTOCOL
SCRIPT_FILENAME
PATH_INFO
QUERY_STRING
IS_SUBREQ
The host name of the remote host
REMOTE_USERThe name of the authenticated user (if any)
REMOTE_IDENTThe user name set by mod_ident
SERVER_NAMEThe server name of the current vhost
SERVER_PORTThe server port of the current vhost
SERVER_PROTOCOLThe protocol used by the request
SERVER_ADMINThe server admin of the current vhost
DOCUMENT_ROOT
The DocumentRoot of + the current vhost
AUTH_TYPE
THE_REQUEST
CONTENT_TYPE
HANDLER
REMOTE_ADDR
The configured auth type (e.g. "basic")
CONTENT_TYPEThe content type of the response
HANDLERThe name of the handler creating the response
HTTPS
"on" if the request uses https, + "off" otherwise
IPV6
"on" if the connection uses IPv6, + "off" otherwise
REQUEST_LOG_ID
The error log id of the request (see + ErrorLogFormat)
CONN_LOG_ID
The error log id of the connection (see + ErrorLogFormat)

Misc variables

- + - + - + - + - + - + - + - + - + - +
NameDescription
TIME_YEAR
The current year (e.g. 2010)
TIME_MON
The current month (1, ..., 12)
TIME_DAY
The current day of the month
TIME_HOUR
The hour part of the current time + (0, ..., 23)
TIME_MIN
The minute part of the current time
TIME_SEC
The second part of the current time
TIME_WDAY
The day of the week (starting with 0 + for Sunday)
TIME
The date and time in the format 20101231235959
SERVER_SOFTWARE
The server version string
API_VERSION
The date of the API version (module magic number)
+

Some modules register additional variables, see e.g. mod_ssl.

+
top

Binary operators

diff --git a/docs/manual/expr.xml b/docs/manual/expr.xml index 5811e38b405..e137c88f7bb 100644 --- a/docs/manual/expr.xml +++ b/docs/manual/expr.xml @@ -104,9 +104,17 @@ listfunction ::= listfuncname "(" word ")"
Variables -

XXX: not all vars are available in all request phases

- -

Request headers (XXX:see req function)

+ +

The expression parser provides a number of variables of the form + %{HTTP_HOST}. Note that the value of a variable may depend + on the phase of the request processing in which it is evaluated. For + example, an expression used in an <If > + directive is evaluated before authentication is done. Therefore, + %{REMOTE_USER} will not be set in this case.

+ +

The following variables provide the values of the named HTTP request + headers. The values of other headers can be obtained witht the + req function.

@@ -128,55 +136,62 @@ listfunction ::= listfuncname "(" word ")" - + - + - + - - - - - - - - - - - - - - - + - + - + + + + + + + + + + + + + + + + + + + - + - - - + - + - - - + - + - + - + - +
NameDescription
REQUEST_METHOD
The HTTP method of the incoming request
REQUEST_SCHEME
The scheme part of the request's URI
REQUEST_URI
The URI of the request
REQUEST_FILENAME
REMOTE_HOST
REMOTE_IDENT
REMOTE_USER
SERVER_ADMIN
SERVER_NAME
SERVER_PORT
SERVER_PROTOCOL
SCRIPT_FILENAME
Same as REQUEST_FILENAME
PATH_INFO
QUERY_STRING
The query string of the current request
IS_SUBREQ
"true" if the current request is a subrequest, + "false" otherwise
THE_REQUESTThe complete request line (e.g., + "GET /index.html HTTP/1.1")
REMOTE_ADDRThe IP address of the remote host
REMOTE_HOSTThe host name of the remote host
REMOTE_USERThe name of the authenticated user (if any)
REMOTE_IDENTThe user name set by mod_ident
SERVER_NAMEThe server name of the current vhost
SERVER_PORTThe server port of the current vhost
SERVER_PROTOCOLThe protocol used by the request
SERVER_ADMINThe server admin of the current vhost
DOCUMENT_ROOT
The DocumentRoot of + the current vhost
AUTH_TYPE
THE_REQUEST
The configured auth type (e.g. "basic")
CONTENT_TYPE
The content type of the response
HANDLER
REMOTE_ADDR
The name of the handler creating the response
HTTPS
"on" if the request uses https, + "off" otherwise
IPV6
"on" if the connection uses IPv6, + "off" otherwise
REQUEST_LOG_ID
The error log id of the request (see + ErrorLogFormat)
CONN_LOG_ID
The error log id of the connection (see + ErrorLogFormat)
@@ -187,27 +202,31 @@ listfunction ::= listfuncname "(" word ")" NameDescription TIME_YEAR - + The current year (e.g. 2010) TIME_MON - + The current month (1, ..., 12) TIME_DAY - + The current day of the month TIME_HOUR - + The hour part of the current time + (0, ..., 23) TIME_MIN - + The minute part of the current time TIME_SEC - + The second part of the current time TIME_WDAY - + The day of the week (starting with 0 + for Sunday) TIME - + The date and time in the format 20101231235959 SERVER_SOFTWARE - + The server version string API_VERSION - + The date of the API version (module magic number) +

Some modules register additional variables, see e.g. mod_ssl.

+