From 5340c4cfbd2afbc7dfcc8d655c797e955ffeec8d Mon Sep 17 00:00:00 2001 From: Vincent Bray Date: Tue, 24 Jul 2007 12:15:22 +0000 Subject: [PATCH] Merge r558837 (Address PR42898 by qualifying the value of Pattern for RewriteRule, and later explaining how to snarf the rest of the request url.) git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@559019 13f79535-47bb-0310-9956-ffa450edef68 --- docs/manual/mod/mod_rewrite.html.en | 26 ++++++++++++++------------ docs/manual/mod/mod_rewrite.xml | 27 ++++++++++++++------------- 2 files changed, 28 insertions(+), 25 deletions(-) diff --git a/docs/manual/mod/mod_rewrite.html.en b/docs/manual/mod/mod_rewrite.html.en index 47f9c7e9fdd..35f0f7fe19c 100644 --- a/docs/manual/mod/mod_rewrite.html.en +++ b/docs/manual/mod/mod_rewrite.html.en @@ -1043,11 +1043,10 @@ later

Pattern is a perl compatible regular - expression, which is applied to the current URL. - ``Current'' means the value of the URL when this rule is - applied. This may not be the originally requested URL, - which may already have matched a previous rule, and have been - altered.

+ expression. On the first RewriteRule it is applied to the + URL-path of the request; + subsequent patterns are applied to the output of the last matched + RewriteRule.

Some hints on the syntax of regular expressions:

@@ -1455,13 +1454,16 @@ should never be necessary and is unsupported.

R-flag.

-

Note: Query String

-

The Pattern will not be matched against the query string. - To do this, you must use a RewriteCond with the - %{QUERY_STRING} variable. You can, however, create - URLs in the substitution string, containing a query string - part. Simply use a question mark inside the substitution string, to - indicate that the following text should be re-injected into the +

What is matched?

+

The Pattern will initially be matched against the part of the + URL after the hostname and port, and before the query string. If you wish + to match against the hostname, port, or query string, use a + RewriteCond with the + %{HTTP_HOST}, %{SERVER_PORT}, or + %{QUERY_STRING} variables respectively.

+

You can, however, create URLs in the substitution string containing a + query string part. Simply use a question mark inside the substitution + string, to indicate that the following text should be re-injected into the query string. When you want to erase an existing query string, end the substitution string with just a question mark. To combine new and old query strings, use the diff --git a/docs/manual/mod/mod_rewrite.xml b/docs/manual/mod/mod_rewrite.xml index f8970775a92..b687d3b78dc 100644 --- a/docs/manual/mod/mod_rewrite.xml +++ b/docs/manual/mod/mod_rewrite.xml @@ -1056,11 +1056,10 @@ RewriteRule ^/$ /homepage.std.html [L]

Pattern is a perl compatible regular - expression, which is applied to the current URL. - ``Current'' means the value of the URL when this rule is - applied. This may not be the originally requested URL, - which may already have matched a previous rule, and have been - altered.

+ expression. On the first RewriteRule it is applied to the + URL-path of the request; + subsequent patterns are applied to the output of the last matched + RewriteRule.

Some hints on the syntax of regular expressions:

@@ -1478,14 +1477,16 @@ should never be necessary and is unsupported.

R-flag.

-Note: Query String -

The Pattern will not be matched against the query string. - To do this, you must use a RewriteCond with the - %{QUERY_STRING} variable. You can, however, create - URLs in the substitution string, containing a query string - part. Simply use a question mark inside the substitution string, to - indicate that the following text should be re-injected into the +What is matched? +

The Pattern will initially be matched against the part of the + URL after the hostname and port, and before the query string. If you wish + to match against the hostname, port, or query string, use a + RewriteCond with the + %{HTTP_HOST}, %{SERVER_PORT}, or + %{QUERY_STRING} variables respectively.

+

You can, however, create URLs in the substitution string containing a + query string part. Simply use a question mark inside the substitution + string, to indicate that the following text should be re-injected into the query string. When you want to erase an existing query string, end the substitution string with just a question mark. To combine new and old query strings, use the -- 2.47.3