Return-Path: Delivered-To: apmail-httpd-cvs-archive@www.apache.org Received: (qmail 56162 invoked from network); 26 Jun 2006 14:56:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 26 Jun 2006 14:56:26 -0000 Received: (qmail 46726 invoked by uid 500); 26 Jun 2006 14:56:25 -0000 Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 46674 invoked by uid 500); 26 Jun 2006 14:56:24 -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 46661 invoked by uid 99); 26 Jun 2006 14:56:24 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Jun 2006 07:56:24 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [140.211.166.113] (HELO eris.apache.org) (140.211.166.113) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Jun 2006 07:56:23 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 023071A983A; Mon, 26 Jun 2006 07:56:02 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r417203 - in /httpd/httpd/trunk/docs/manual/rewrite: flags.html flags.html.en flags.xml flags.xml.meta Date: Mon, 26 Jun 2006 14:56:02 -0000 To: cvs@httpd.apache.org From: rbowen@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20060626145603.023071A983A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: rbowen Date: Mon Jun 26 07:56:01 2006 New Revision: 417203 URL: http://svn.apache.org/viewvc?rev=417203&view=rev Log: Adding a flags document. Not yet linked from anywhere. Will link once fleshed out a little more. The goal is to give more examples for the available flags. Added: httpd/httpd/trunk/docs/manual/rewrite/flags.html httpd/httpd/trunk/docs/manual/rewrite/flags.html.en httpd/httpd/trunk/docs/manual/rewrite/flags.xml httpd/httpd/trunk/docs/manual/rewrite/flags.xml.meta Added: httpd/httpd/trunk/docs/manual/rewrite/flags.html URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/rewrite/flags.html?rev=417203&view=auto ============================================================================== --- httpd/httpd/trunk/docs/manual/rewrite/flags.html (added) +++ httpd/httpd/trunk/docs/manual/rewrite/flags.html Mon Jun 26 07:56:01 2006 @@ -0,0 +1,3 @@ +URI: flags.html.en +Content-Language: en +Content-type: text/html; charset=ISO-8859-1 Added: httpd/httpd/trunk/docs/manual/rewrite/flags.html.en URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/rewrite/flags.html.en?rev=417203&view=auto ============================================================================== --- httpd/httpd/trunk/docs/manual/rewrite/flags.html.en (added) +++ httpd/httpd/trunk/docs/manual/rewrite/flags.html.en Mon Jun 26 07:56:01 2006 @@ -0,0 +1,174 @@ + + + +Apache mod_rewrite Flags - Apache HTTP Server + + + + + +
<-
+

Apache mod_rewrite Flags

+
+

Available Languages:  en 

+
+ +

This document discusses the flags which are available to the +RewriteRule directive, +providing more detailed explanations and examples of each.

+
+ +
top
+
+

Introduction

+

RewriteRules can have +their behavior modified by one or more flags. Flags are included in +square brackets at the end of the rule, and multiple flags are separated +by commas.

+
top
+
+

The flags

+ +

Each flag has a long and short form. While it is most common to use +the short form, it is recommended that you familiarize yourself with the +long form, so that you remember what each flag is supposed to do.

+ +

Presented here are each of the available flags, along with an example +of how you might use them.

+ +

C|chain

+

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 ruls that are chained together, will be +skipped.

+ + + +

CO|cookie

+

The [CO], or [cookie] flag, allows you to set a cookie when a +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 +domain for which you wish the cookie to be valid. You may optionally set +the lifetime of the cookie, and the path for which it should be +returned.

+

By default, the lifetime of the cookie is the current browser +session.

+

By default, the path for which the cookie will be valid is "/" - that +is, the entire website.

+

Several examples are offered here:

+ +

+RewriteEngine On
+RewriteRule ^/index.html - [CO=frontdoor=yes:.apache.org:1440:/] +

+ +

This rule doesn't rewrite the request (the "-" rewrite target tells +mod_rewrite to pass the request through unchanged) but sets a cookie +called 'frontdoor' to a value of 'yes'. The cookie is valid for any host +in the .apache.org domain. It will be set to expire in 1440 +minutes (24 hours) and will be returned for all URIs.

+ + + +

E|env

+

With the [E], or [env] flag, you can set the value of an environment +variable. Note that some variables may be set after the rule is run, and +so setting them in the RewriteRule won't work, since it will +be changed afterwards.

+ +

The following example sets an evironment variable called 'image' to a +value of '1' if the requested URI is an image file. Then, that +environment variable is used to exclude those requests from the access +log.

+ +

+RewriteRule %{REQUEST_URI} \.(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 +an example, not as a recommendation.

+ + +

F|forbidden

+

Forbidden flag

+ + +

G|gone

+

Forbidden flag

+ + +

H|handler

+

Handler flag

+ + +

L|last

+

Last flag

+ + +

N|next

+

Next round flag

+ + +

NC|nocase

+

No case flag

+ + +

NE|noescape

+

No escape flag

+ + +

NS|nosubreq

+

No internal subrequest flag

+ + +

P|proxy

+

Proxy flag

+ + +

PT|passthrough

+

Passthrough flag

+ + +

PT|passthrough

+

Passthrough flag

+ + +

QSA|qsappend

+

Query String Append flag

+ + +

R|redirect

+

Redirect flag

+ + +

S|skip

+

Skip flag

+ + +

T|type

+

Type flag

+ + +
+
+

Available Languages:  en 

+
+ \ No newline at end of file Added: httpd/httpd/trunk/docs/manual/rewrite/flags.xml URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/rewrite/flags.xml?rev=417203&view=auto ============================================================================== --- httpd/httpd/trunk/docs/manual/rewrite/flags.xml (added) +++ httpd/httpd/trunk/docs/manual/rewrite/flags.xml Mon Jun 26 07:56:01 2006 @@ -0,0 +1,187 @@ + + + + + + + + + + + Apache mod_rewrite Flags + + +

This document discusses the flags which are available to the +RewriteRule directive, +providing more detailed explanations and examples of each.

+
+ +Module documentation +Technical details +Practical solutions to common +problems +Practical solutions to +advanced problems + +
Introduction +

RewriteRules can have +their behavior modified by one or more flags. Flags are included in +square brackets at the end of the rule, and multiple flags are separated +by commas.

+ +RewriteRule pattern target [Flag1,Flag2,Flag3] + + +

The flags all have a short form, such as CO, as well as +a longer form, such as cookie. Some flags take one or more +arguments. Flags are not case sensitive.

+ +
+ +
The flags + +

Each flag has a long and short form. While it is most common to use +the short form, it is recommended that you familiarize yourself with the +long form, so that you remember what each flag is supposed to do.

+ +

Presented here are each of the available flags, along with an example +of how you might use them.

+ +
C|chain +

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 ruls that are chained together, will be +skipped.

+ +
+ +
CO|cookie +

The [CO], or [cookie] flag, allows you to set a cookie when a +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 +domain for which you wish the cookie to be valid. You may optionally set +the lifetime of the cookie, and the path for which it should be +returned.

+

By default, the lifetime of the cookie is the current browser +session.

+

By default, the path for which the cookie will be valid is "/" - that +is, the entire website.

+

Several examples are offered here:

+ + +RewriteEngine On
+RewriteRule ^/index.html - [CO=frontdoor=yes:.apache.org:1440:/] +
+ +

This rule doesn't rewrite the request (the "-" rewrite target tells +mod_rewrite to pass the request through unchanged) but sets a cookie +called 'frontdoor' to a value of 'yes'. The cookie is valid for any host +in the .apache.org domain. It will be set to expire in 1440 +minutes (24 hours) and will be returned for all URIs.

+ +
+ +
E|env +

With the [E], or [env] flag, you can set the value of an environment +variable. Note that some variables may be set after the rule is run, and +so setting them in the RewriteRule won't work, since it will +be changed afterwards.

+ +

The following example sets an evironment variable called 'image' to a +value of '1' if the requested URI is an image file. Then, that +environment variable is used to exclude those requests from the access +log.

+ + +RewriteRule %{REQUEST_URI} \.(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 +an example, not as a recommendation.

+
+ +
F|forbidden +

Forbidden flag

+
+ +
G|gone +

Gone flag

+
+ +
H|handler +

Handler flag

+
+ +
L|last +

Last flag

+
+ +
N|next +

Next round flag

+
+ +
NC|nocase +

No case flag

+
+ +
NE|noescape +

No escape flag

+
+ +
NS|nosubreq +

No internal subrequest flag

+
+ +
P|proxy +

Proxy flag

+
+ +
PT|passthrough +

Passthrough flag

+
+ +
PT|passthrough +

Passthrough flag

+
+ +
QSA|qsappend +

Query String Append flag

+
+ +
R|redirect +

Redirect flag

+
+ +
S|skip +

Skip flag

+
+ +
T|type +

Type flag

+
+ +
+
+ Added: httpd/httpd/trunk/docs/manual/rewrite/flags.xml.meta URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/rewrite/flags.xml.meta?rev=417203&view=auto ============================================================================== --- httpd/httpd/trunk/docs/manual/rewrite/flags.xml.meta (added) +++ httpd/httpd/trunk/docs/manual/rewrite/flags.xml.meta Mon Jun 26 07:56:01 2006 @@ -0,0 +1,11 @@ + + + + flags + /rewrite/ + .. + + + en + +