From 323a97156fbaa14960121a9d2c768fc67a826928 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20Malo?= Date: Thu, 13 Mar 2008 09:43:32 +0000 Subject: [PATCH] update transformation git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@636682 13f79535-47bb-0310-9956-ffa450edef68 --- docs/manual/rewrite/rewrite_flags.html.en | 78 +++++++++++------------ 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/docs/manual/rewrite/rewrite_flags.html.en b/docs/manual/rewrite/rewrite_flags.html.en index 8d73f0730c..518b00df9f 100644 --- a/docs/manual/rewrite/rewrite_flags.html.en +++ b/docs/manual/rewrite/rewrite_flags.html.en @@ -6,35 +6,35 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX --> Apache mod_rewrite Flags - Apache HTTP Server - - - - + + + + -
<-
+ +
<-
-Apache > HTTP Server > Documentation > Version 2.3

Apache mod_rewrite Flags

+Apache > HTTP Server > Documentation > Version 2.3

Apache mod_rewrite Flags

-

Available Languages:

+

Available Languages:  en 

This document discusses the flags which are available to the -RewriteRule directive, +RewriteRule directive, providing detailed explanations and examples. This is not necessarily a comprehensive list of all flags available, so be sure to also consult the reference documentation.

-
top

The flags

@@ -58,7 +58,7 @@ long form, so that you remember what each flag is supposed to do.

of how you might use them.

C|chain

-

The [C] or [chain] flag indicates that the RewriteRule is chained to the next +

The [C] or [chain] flag indicates that the RewriteRule is chained to the next rule. That is, if the rule matches, then it is processed as usual and control moves on to the next rule. However, if it does not match, then the next rule, and any other rules that are chained together, will be @@ -68,7 +68,7 @@ skipped.

CO|cookie

The [CO], or [cookie] flag, allows you to set a cookie when a -particular RewriteRule +particular RewriteRule matches. The argument consists of three required fields and two optional fields.

You must declare a name and value for the cookie to be set, and the @@ -111,14 +111,14 @@ RewriteRule \.(png|gif|jpg) - [E=image:1]
CustomLog logs/access_log combined env=!image

-

Note that this same effect can be obtained using SetEnvIf. This technique is offered as +

Note that this same effect can be obtained using SetEnvIf. This technique is offered as an example, not as a recommendation.

F|forbidden

Using the [F] flag causes Apache to return a 403 Forbidden status code to the client. While the same behavior can be accomplished using -the Deny directive, this +the Deny directive, this allows more flexibility in assigning a Forbidden status.

The following rule will forbid .exe files from being @@ -163,25 +163,25 @@ that does not contain the literal . character.

L|last

-

The [L] flag causes mod_rewrite to stop processing +

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 +

If you are using RewriteRule in either .htaccess files or in -<Directory> sections, +<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 +<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 +

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, as shown below.

@@ -219,7 +219,7 @@ pattern still matches, perform this substitution.

NC|nocase

-

Use of the [NC] flag causes the RewriteRule to be matched in a +

Use of the [NC] flag causes the RewriteRule to be matched in a case-insensitive manner. That is, it doesn't care whether letters appear as upper-case or lower-case in the matched URI.

@@ -267,7 +267,7 @@ requests.

P|proxy

Use of the [P] flag causes the request to be handled by -mod_proxy, and handled via a proxy request. For +mod_proxy, and handled via a proxy request. For example, if you wanted all image requests to be handled by a back-end image server, you might do something like the following:

@@ -287,17 +287,17 @@ considered.

The target (or substitution string) in a RewriteRule is assumed to be a file path, by default. The use of the [PT] flag causes it to be trated as a URI instead. That is to say, the -use of the [PT] flag causes the result of the RewriteRule to be passed back through -URL mapping, so that location-based mappings, such as Alias, for example, might have a chance to take +use of the [PT] flag causes the result of the RewriteRule to be passed back through +URL mapping, so that location-based mappings, such as Alias, for example, might have a chance to take effect.

If, for example, you have an -Alias -for /icons, and have a RewriteRule pointing there, you should +Alias +for /icons, and have a RewriteRule pointing there, you should use the [PT] flag to ensure that the -Alias is evaluated. +Alias is evaluated.

@@ -315,7 +315,7 @@ ignored, resulting in a 'File not found' error being returned.

QSA|qsappend

When the replacement URI contains a query string, the default behavior -of RewriteRule is to discard +of RewriteRule is to discard the existing query string, and replace it with the newly generated one. Using the [QSA] flag causes the query strings to be combined.

@@ -361,7 +361,7 @@ URI in request' warnings.

S|skip

The [S] flag is used to skip rules that you don't want to run. This can be thought of as a goto statement in your rewrite -ruleset. In the following example, we only want to run the RewriteRule if the requested URI +ruleset. In the following example, we only want to run the RewriteRule if the requested URI doesn't correspond with an actual file.

@@ -375,8 +375,8 @@ RewriteRule (.*\.gif) images.php?$1
RewriteRule (.*\.html) docs.php?$1

-

This technique is useful because a RewriteCond only applies to the -RewriteRule immediately +

This technique is useful because a RewriteCond only applies to the +RewriteRule immediately following it. Thus, if you want to make a RewriteCond apply to several RewriteRules, one possible technique is to negate those conditions and use a [Skip] flag.

@@ -385,7 +385,7 @@ negate those conditions and use a [Skip] flag.

T|type

Sets the MIME type with which the resulting response will be -sent. This has the same effect as the AddType directive.

+sent. This has the same effect as the AddType directive.

For example, you might use the following technique to serve Perl source code as plain text, if requested in a particular way:

@@ -405,7 +405,7 @@ RewriteRule IMG - [T=image/jpg]

Please note that this is a trivial example, and could be better done -using <FilesMatch> +using <FilesMatch> instead. Always consider the alternate solutions to a problem before resorting to rewrite, which will invariably be a less efficient solution than the alternatives.

@@ -413,8 +413,8 @@ invariably be a less efficient solution than the alternatives.

-

Available Languages:

+

Available Languages:  en 

+ \ No newline at end of file -- 2.40.0