Return-Path: X-Original-To: apmail-httpd-cvs-archive@www.apache.org Delivered-To: apmail-httpd-cvs-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 21B3F113FC for ; Mon, 12 May 2014 21:08:40 +0000 (UTC) Received: (qmail 41700 invoked by uid 500); 12 May 2014 21:02:00 -0000 Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 41637 invoked by uid 500); 12 May 2014 21:02:00 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 41630 invoked by uid 99); 12 May 2014 21:02:00 -0000 Received: from Unknown (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 May 2014 21:02:00 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 May 2014 21:01:58 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id A8C0023889CB; Mon, 12 May 2014 21:01:37 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1594094 - in /httpd/httpd/trunk/docs/manual/mod: mod_rewrite.html.en mod_rewrite.xml Date: Mon, 12 May 2014 21:01:37 -0000 To: cvs@httpd.apache.org From: jailletc36@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20140512210137.A8C0023889CB@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: jailletc36 Date: Mon May 12 21:01:36 2014 New Revision: 1594094 URL: http://svn.apache.org/r1594094 Log: Based on report from Ken Zalewski, on online doc. Add missing Server-Variables useable in RewriteCond directive. Introduced in r1132494 CONTEXT_PREFIX CONTEXT_DOCUMENT_ROOT Introduced in r737973 IPV6 Missing for ages! SCRIPT_GROUP SCRIPT_USER I have added where I found it logical, feel free to adjust. I have also reordered this table to ease reading. Finally, I have beautified some tables at the end. Modified: httpd/httpd/trunk/docs/manual/mod/mod_rewrite.html.en httpd/httpd/trunk/docs/manual/mod/mod_rewrite.xml Modified: httpd/httpd/trunk/docs/manual/mod/mod_rewrite.html.en URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/mod/mod_rewrite.html.en?rev=1594094&r1=1594093&r2=1594094&view=diff ============================================================================== --- httpd/httpd/trunk/docs/manual/mod/mod_rewrite.html.en (original) +++ httpd/httpd/trunk/docs/manual/mod/mod_rewrite.html.en Mon May 12 21:01:36 2014 @@ -209,27 +209,30 @@ Alias /myapp /opt/myapp-1.2.3 - HTTP_USER_AGENT
- HTTP_REFERER
+ HTTP_ACCEPT
HTTP_COOKIE
HTTP_FORWARDED
HTTP_HOST
HTTP_PROXY_CONNECTION
- HTTP_ACCEPT
+ HTTP_REFERER
+ HTTP_USER_AGENT
- REMOTE_ADDR
+ AUTH_TYPE
CONN_REMOTE_ADDR
+ CONTEXT_PREFIX
+ CONTEXT_DOCUMENT_ROOT
+ IPV6
+ PATH_INFO
+ QUERY_STRING
+ REMOTE_ADDR
REMOTE_HOST
+ REMOTE_IDENT
REMOTE_PORT
REMOTE_USER
- REMOTE_IDENT
REQUEST_METHOD
SCRIPT_FILENAME
- PATH_INFO
- QUERY_STRING
- AUTH_TYPE
@@ -242,9 +245,11 @@ Alias /myapp /opt/myapp-1.2.3 DOCUMENT_ROOT
+ SCRIPT_GROUP
+ SCRIPT_USER
+ SERVER_ADDR
SERVER_ADMIN
SERVER_NAME
- SERVER_ADDR
SERVER_PORT
SERVER_PROTOCOL
SERVER_SOFTWARE
@@ -263,14 +268,14 @@ Alias /myapp /opt/myapp-1.2.3 API_VERSION
- THE_REQUEST
- REQUEST_URI
- REQUEST_FILENAME
- IS_SUBREQ
+ CONN_REMOTE_ADDR
HTTPS
- REQUEST_SCHEME
+ IS_SUBREQ
REMOTE_ADDR
- CONN_REMOTE_ADDR
+ REQUEST_FILENAME
+ REQUEST_SCHEME
+ REQUEST_URI
+ THE_REQUEST
@@ -279,8 +284,8 @@ Alias /myapp /opt/myapp-1.2.3 correspond to the similarly named HTTP MIME-headers, C variables of the Apache HTTP Server or struct tm fields of the Unix system. - Most are documented elsewhere in the Manual or in - the CGI specification.

+ Most are documented here + or elsewhere in the Manual or in the CGI specification.

SERVER_NAME and SERVER_PORT depend on the values of UseCanonicalName and @@ -290,14 +295,6 @@ Alias /myapp /opt/myapp-1.2.3

Those that are special to mod_rewrite include those below.

-
IS_SUBREQ
- -
Will contain the text "true" if the request - currently being processed is a sub-request, - "false" otherwise. Sub-requests may be generated - by modules that need to resolve additional files - or URIs in order to complete their tasks.
-
API_VERSION
This is the version of the Apache httpd module API @@ -309,21 +306,30 @@ Alias /myapp /opt/myapp-1.2.3 instance, it is 19990320:10), but is mainly of interest to module authors.
-
THE_REQUEST
+
CONN_REMOTE_ADDR
-
The full HTTP request line sent by the - browser to the server (e.g., "GET - /index.html HTTP/1.1"). This does not - include any additional headers sent by the - browser. This value has not been unescaped - (decoded), unlike most other variables below.
+
Since 2.4.8: The peer IP address of the connection (see the + mod_remoteip module).
-
REQUEST_URI
+
HTTPS
-
The path component of the requested URI, - such as "/index.html". This notably excludes the - query string which is available as as its own variable - named QUERY_STRING.
+
Will contain the text "on" if the connection is + using SSL/TLS, or "off" otherwise. (This variable + can be safely used regardless of whether or not + mod_ssl is loaded).
+ +
IS_SUBREQ
+ +
Will contain the text "true" if the request + currently being processed is a sub-request, + "false" otherwise. Sub-requests may be generated + by modules that need to resolve additional files + or URIs in order to complete their tasks.
+ +
REMOTE_ADDR
+ +
The IP address of the remote host (see the + mod_remoteip module).
REQUEST_FILENAME
@@ -338,26 +344,27 @@ Alias /myapp /opt/myapp-1.2.3 REQUEST_URI to map the request to a file. -
HTTPS
- -
Will contain the text "on" if the connection is - using SSL/TLS, or "off" otherwise. (This variable - can be safely used regardless of whether or not - mod_ssl is loaded).
-
REQUEST_SCHEME
Will contain the scheme of the request (usually "http" or "https"). This value can be influenced with ServerName.
-
REMOTE_ADDR
-
The IP address of the remote host (see the - mod_remoteip module).
+
REQUEST_URI
-
CONN_REMOTE_ADDR
-
Since 2.4.8: The peer IP address of the connection (see the - mod_remoteip module).
+
The path component of the requested URI, + such as "/index.html". This notably excludes the + query string which is available as as its own variable + named QUERY_STRING.
+ +
THE_REQUEST
+ +
The full HTTP request line sent by the + browser to the server (e.g., "GET + /index.html HTTP/1.1"). This does not + include any additional headers sent by the + browser. This value has not been unescaped + (decoded), unlike most other variables below.
@@ -1169,136 +1176,134 @@ cannot use $N in the substi brackets, of any of the flags in the following table. More details, and examples, for each flag, are available in the Rewrite Flags document.

- - +
Flag and syntax
- + - + - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + -
Flag and syntax Function
B Escape non-alphanumeric characters in backreferences before applying the transformation. details ...
backrefnoplus|BNP If backreferences are being escaped, spaces should be escaped to %20 instead of +. Useful when the backreference will be used in the path component rather than the query string.details ...
chain|C Rule is chained to the following rule. If the rule fails, the rule(s) chained to it will be skipped. details ...
cookie|CO=NAME:VAL Sets a cookie in the client browser. Full syntax is: CO=NAME:VAL:domain[:lifetime[:path[:secure[:httponly]]]] details ...
discardpath|DPI Causes the PATH_INFO portion of the rewritten URI to be discarded. details ...
END Stop the rewriting process immediately and don't apply any more rules. Also prevents further execution of rewrite rules in per-directory and .htaccess context. (Available in 2.3.9 and later) details ...
env|E=[!]VAR[:VAL] Causes an environment variable VAR to be set (to the value VAL if provided). The form !VAR causes the environment variable VAR to be unset. details ...
forbidden|F Returns a 403 FORBIDDEN response to the client browser. details ...
gone|G Returns a 410 GONE response to the client browser. details ...
Handler|H=Content-handler Causes the resulting URI to be sent to the specified Content-handler for processing. details ...
last|L Stop the rewriting process immediately and don't apply any more rules. Especially note caveats for per-directory and .htaccess context (see also the END flag). details ...
next|N Re-run the rewriting process, starting again with the first rule, using the result of the ruleset so far as a starting point. details ...
nocase|NC Makes the pattern comparison case-insensitive. details ...
noescape|NE Prevent mod_rewrite from applying hexcode escaping of special characters in the result of the rewrite. details ...
nosubreq|NS Causes a rule to be skipped if the current request is an internal sub-request. details ...
proxy|P Force the substitution URL to be internally sent as a proxy request. details ...
passthrough|PT Forces the resulting URI to be passed back to the URL mapping engine for processing of other URI-to-filename translators, such as Alias or Redirect. details ...
qsappend|QSA Appends any query string from the original request URL to any query string created in the rewrite target.details ...
qsdiscard|QSD Discard any query string attached to the incoming URI. details ...
redirect|R[=code] Forces an external redirect, optionally with the specified HTTP status code. details ...
skip|S=num Tells the rewriting engine to skip the next num rules if the current rule matches. details ...
type|T=MIME-type Force the MIME-type of the target file to be the specified type. details ...
+

Home directory expansion

When the substitution string begins with a string @@ -1321,68 +1326,55 @@ directive.

/somepath/pathinfo'':

- - +
- - - + - - - + - - - + - - - + - - - + - - - + @@ -1396,74 +1388,59 @@ directive.

/somepath/localpath/pathinfo'':

-
Given Rule Resulting Substitution
^/somepath(.*) otherpath$1 invalid, not supported
^/somepath(.*) otherpath$1 [R] invalid, not supported
^/somepath(.*) otherpath$1 [P] invalid, not supported
^/somepath(.*) /otherpath$1 /otherpath/pathinfo
^/somepath(.*) /otherpath$1 [R] http://thishost/otherpath/pathinfo via external redirection
^/somepath(.*) /otherpath$1 [P] doesn't make sense, not supported
^/somepath(.*) http://thishost/otherpath$1 /otherpath/pathinfo
^/somepath(.*) http://thishost/otherpath$1 [R] http://thishost/otherpath/pathinfo via external redirection
^/somepath(.*) http://thishost/otherpath$1 [P] doesn't make sense, not supported
^/somepath(.*) http://otherhost/otherpath$1 http://otherhost/otherpath/pathinfo via external redirection
^/somepath(.*) http://otherhost/otherpath$1 [R] http://otherhost/otherpath/pathinfo via external redirection (the [R] flag is redundant)
^/somepath(.*) http://otherhost/otherpath$1 [P] http://otherhost/otherpath/pathinfo via internal proxy
- - +
- - - + - - - + - - - + - - - + - - - + - - - + -
Given Rule Resulting Substitution
^localpath(.*) otherpath$1 /somepath/otherpath/pathinfo
^localpath(.*) otherpath$1 [R] http://thishost/somepath/otherpath/pathinfo via external redirection
^localpath(.*) otherpath$1 [P] doesn't make sense, not supported
^localpath(.*) /otherpath$1 /otherpath/pathinfo
^localpath(.*) /otherpath$1 [R] http://thishost/otherpath/pathinfo via external redirection
^localpath(.*) /otherpath$1 [P] doesn't make sense, not supported
^localpath(.*) http://thishost/otherpath$1 /otherpath/pathinfo
^localpath(.*) http://thishost/otherpath$1 [R] http://thishost/otherpath/pathinfo via external redirection
^localpath(.*) http://thishost/otherpath$1 [P] doesn't make sense, not supported
^localpath(.*) http://otherhost/otherpath$1 http://otherhost/otherpath/pathinfo via external redirection
^localpath(.*) http://otherhost/otherpath$1 [R] http://otherhost/otherpath/pathinfo via external redirection (the [R] flag is redundant)
^localpath(.*) http://otherhost/otherpath$1 [P] http://otherhost/otherpath/pathinfo via internal proxy
Modified: httpd/httpd/trunk/docs/manual/mod/mod_rewrite.xml URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/mod/mod_rewrite.xml?rev=1594094&r1=1594093&r2=1594094&view=diff ============================================================================== --- httpd/httpd/trunk/docs/manual/mod/mod_rewrite.xml (original) +++ httpd/httpd/trunk/docs/manual/mod/mod_rewrite.xml Mon May 12 21:01:36 2014 @@ -463,27 +463,30 @@ Alias /myapp /opt/myapp-1.2.3 - HTTP_USER_AGENT
- HTTP_REFERER
+ HTTP_ACCEPT
HTTP_COOKIE
HTTP_FORWARDED
HTTP_HOST
HTTP_PROXY_CONNECTION
- HTTP_ACCEPT
+ HTTP_REFERER
+ HTTP_USER_AGENT
- REMOTE_ADDR
+ AUTH_TYPE
CONN_REMOTE_ADDR
+ CONTEXT_PREFIX
+ CONTEXT_DOCUMENT_ROOT
+ IPV6
+ PATH_INFO
+ QUERY_STRING
+ REMOTE_ADDR
REMOTE_HOST
+ REMOTE_IDENT
REMOTE_PORT
REMOTE_USER
- REMOTE_IDENT
REQUEST_METHOD
SCRIPT_FILENAME
- PATH_INFO
- QUERY_STRING
- AUTH_TYPE
@@ -496,9 +499,11 @@ Alias /myapp /opt/myapp-1.2.3 DOCUMENT_ROOT
+ SCRIPT_GROUP
+ SCRIPT_USER
+ SERVER_ADDR
SERVER_ADMIN
SERVER_NAME
- SERVER_ADDR
SERVER_PORT
SERVER_PROTOCOL
SERVER_SOFTWARE
@@ -517,14 +522,14 @@ Alias /myapp /opt/myapp-1.2.3 API_VERSION
- THE_REQUEST
- REQUEST_URI
- REQUEST_FILENAME
- IS_SUBREQ
+ CONN_REMOTE_ADDR
HTTPS
- REQUEST_SCHEME
+ IS_SUBREQ
REMOTE_ADDR
- CONN_REMOTE_ADDR
+ REQUEST_FILENAME
+ REQUEST_SCHEME
+ REQUEST_URI
+ THE_REQUEST
@@ -533,8 +538,8 @@ Alias /myapp /opt/myapp-1.2.3 correspond to the similarly named HTTP MIME-headers, C variables of the Apache HTTP Server or struct tm fields of the Unix system. - Most are documented elsewhere in the Manual or in - the CGI specification.

+ Most are documented here + or elsewhere in the Manual or in the CGI specification.

SERVER_NAME and SERVER_PORT depend on the values of UseCanonicalName and @@ -544,14 +549,6 @@ Alias /myapp /opt/myapp-1.2.3

Those that are special to mod_rewrite include those below.

-
IS_SUBREQ
- -
Will contain the text "true" if the request - currently being processed is a sub-request, - "false" otherwise. Sub-requests may be generated - by modules that need to resolve additional files - or URIs in order to complete their tasks.
-
API_VERSION
This is the version of the Apache httpd module API @@ -563,21 +560,30 @@ Alias /myapp /opt/myapp-1.2.3 instance, it is 19990320:10), but is mainly of interest to module authors.
-
THE_REQUEST
+
CONN_REMOTE_ADDR
-
The full HTTP request line sent by the - browser to the server (e.g., "GET - /index.html HTTP/1.1"). This does not - include any additional headers sent by the - browser. This value has not been unescaped - (decoded), unlike most other variables below.
+
Since 2.4.8: The peer IP address of the connection (see the + mod_remoteip module).
-
REQUEST_URI
+
HTTPS
-
The path component of the requested URI, - such as "/index.html". This notably excludes the - query string which is available as as its own variable - named QUERY_STRING.
+
Will contain the text "on" if the connection is + using SSL/TLS, or "off" otherwise. (This variable + can be safely used regardless of whether or not + mod_ssl is loaded).
+ +
IS_SUBREQ
+ +
Will contain the text "true" if the request + currently being processed is a sub-request, + "false" otherwise. Sub-requests may be generated + by modules that need to resolve additional files + or URIs in order to complete their tasks.
+ +
REMOTE_ADDR
+ +
The IP address of the remote host (see the + mod_remoteip module).
REQUEST_FILENAME
@@ -592,26 +598,27 @@ Alias /myapp /opt/myapp-1.2.3 REQUEST_URI to map the request to a file. -
HTTPS
- -
Will contain the text "on" if the connection is - using SSL/TLS, or "off" otherwise. (This variable - can be safely used regardless of whether or not - mod_ssl is loaded).
-
REQUEST_SCHEME
Will contain the scheme of the request (usually "http" or "https"). This value can be influenced with ServerName.
-
REMOTE_ADDR
-
The IP address of the remote host (see the - mod_remoteip module).
+
REQUEST_URI
-
CONN_REMOTE_ADDR
-
Since 2.4.8: The peer IP address of the connection (see the - mod_remoteip module).
+
The path component of the requested URI, + such as "/index.html". This notably excludes the + query string which is available as as its own variable + named QUERY_STRING.
+ +
THE_REQUEST
+ +
The full HTTP request line sent by the + browser to the server (e.g., "GET + /index.html HTTP/1.1"). This does not + include any additional headers sent by the + browser. This value has not been unescaped + (decoded), unlike most other variables below.
@@ -1183,7 +1190,7 @@ cannot use $N in the substi details, and examples, for each flag, are available in the Rewrite Flags document.

- +
@@ -1348,7 +1355,7 @@ directive.

/somepath/pathinfo'':

-
Flag and syntax Function
+
@@ -1423,7 +1430,7 @@ directive.

/somepath/localpath/pathinfo'':

-
Given Rule Resulting Substitution
+
Given Rule