From b24a96a731110dc4780928e6b44c8ba4081c2aa0 Mon Sep 17 00:00:00 2001 From: Rich Bowen Date: Sun, 5 Aug 2007 12:24:31 +0000 Subject: [PATCH] Trying to fill in some of the flags here, complete with detailed explanations and examples. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@562855 13f79535-47bb-0310-9956-ffa450edef68 --- docs/manual/rewrite/flags.html.en | 48 +++++++++++++++++++++++++---- docs/manual/rewrite/flags.xml | 50 +++++++++++++++++++++++++++---- 2 files changed, 88 insertions(+), 10 deletions(-) diff --git a/docs/manual/rewrite/flags.html.en b/docs/manual/rewrite/flags.html.en index 6e05e7267a..366987357c 100644 --- a/docs/manual/rewrite/flags.html.en +++ b/docs/manual/rewrite/flags.html.en @@ -126,25 +126,63 @@ downloaded from your server.

RewriteRule \.exe - [F]

-

This rule uses the "-" syntax for the rewrite target, which means +

This example uses the "-" syntax for the rewrite target, which means that the requested URI is not modified.

G|gone

-

Gone flag

+

The [G] flag forces Apache to return a 410 Gone status with the +response. This indicates that a resource used to be available, but is no +longer available.

H|handler

-

Handler flag

+

Forces the resulting request to be handled with the specified +handler. For example, one might use this to force all files without a +file extension to be parsed by the php handler:

+ +

+RewriteRule !\. - [H=application/x-httpd-php .php] +

+ +

+The regular expression above - !\. - will match any request +that does not contain the literal . character. +

L|last

-

Last flag

+

The [L] flag causes mod_rewrite to stop processing +the rule set. In most contexts, this means that if the rule matches, no +further rules will be processed.

+ +

If you are using RewriteRule in either +.htaccess files or in +<Directory> sections, +it is important to have some understanding of how the rules are +processed. The simplified form of this is that once the rules have been +processed, the rewritten request is handed back to the URL parsing +engine to do what it may with it. It is possible that as the rewritten +request is handled, the .htaccess file or +<Directory> section +may be encountered again, and thus the ruleset may be run again from the +start. Most commonly this will happen if one of the rules causes a +redirect - either internal or external - causing the request process to +start over.

+ +

It is therefore important, if you are using RewriteRule directives in one of these +context that you take explicit steps to avoid rules looping, and not +count solely on the [L] flag to terminate execution of a series of +rules.

N|next

-

Next round flag

+

+The [N] flag causes the ruleset to start over again from the top. Use +with extreme caution, as it may result in loop. +

+

NC|nocase

diff --git a/docs/manual/rewrite/flags.xml b/docs/manual/rewrite/flags.xml index afca0ec817..c9887a8103 100644 --- a/docs/manual/rewrite/flags.xml +++ b/docs/manual/rewrite/flags.xml @@ -134,25 +134,65 @@ downloaded from your server.

RewriteRule \.exe - [F] -

This rule uses the "-" syntax for the rewrite target, which means +

This example uses the "-" syntax for the rewrite target, which means that the requested URI is not modified.

G|gone -

Gone flag

+

The [G] flag forces Apache to return a 410 Gone status with the +response. This indicates that a resource used to be available, but is no +longer available.

H|handler -

Handler flag

+

Forces the resulting request to be handled with the specified +handler. For example, one might use this to force all files without a +file extension to be parsed by the php handler:

+ + +RewriteRule !\. - [H=application/x-httpd-php .php] + + +

+The regular expression above - !\. - will match any request +that does not contain the literal . character. +

L|last -

Last flag

+

The [L] flag causes mod_rewrite to stop processing +the rule set. In most contexts, this means that if the rule matches, no +further rules will be processed.

+ +

If you are using RewriteRule in either +.htaccess files or in +Directory sections, +it is important to have some understanding of how the rules are +processed. The simplified form of this is that once the rules have been +processed, the rewritten request is handed back to the URL parsing +engine to do what it may with it. It is possible that as the rewritten +request is handled, the .htaccess file or +Directory section +may be encountered again, and thus the ruleset may be run again from the +start. Most commonly this will happen if one of the rules causes a +redirect - either internal or external - causing the request process to +start over.

+ +

It is therefore important, if you are using RewriteRule directives in one of these +context that you take explicit steps to avoid rules looping, and not +count solely on the [L] flag to terminate execution of a series of +rules.

N|next -

Next round flag

+

+The [N] flag causes the ruleset to start over again from the top. Use +with extreme caution, as it may result in loop. +

+
NC|nocase -- 2.40.0