diff options
author | Rich Bowen <rbowen@apache.org> | 2006-06-26 16:56:01 +0200 |
---|---|---|
committer | Rich Bowen <rbowen@apache.org> | 2006-06-26 16:56:01 +0200 |
commit | 64d5e756cda58e7fc0ad72bf54401d810662b1c7 (patch) | |
tree | b84d75bcf9267cbf814f5f5ff980ef43e4aa35a1 /docs/manual | |
parent | update transformation (diff) | |
download | apache2-64d5e756cda58e7fc0ad72bf54401d810662b1c7.tar.xz apache2-64d5e756cda58e7fc0ad72bf54401d810662b1c7.zip |
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.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@417203 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'docs/manual')
-rw-r--r-- | docs/manual/rewrite/flags.html | 3 | ||||
-rw-r--r-- | docs/manual/rewrite/flags.html.en | 174 | ||||
-rw-r--r-- | docs/manual/rewrite/flags.xml | 187 | ||||
-rw-r--r-- | docs/manual/rewrite/flags.xml.meta | 11 |
4 files changed, 375 insertions, 0 deletions
diff --git a/docs/manual/rewrite/flags.html b/docs/manual/rewrite/flags.html new file mode 100644 index 0000000000..5ea39bca4f --- /dev/null +++ b/docs/manual/rewrite/flags.html @@ -0,0 +1,3 @@ +URI: flags.html.en +Content-Language: en +Content-type: text/html; charset=ISO-8859-1 diff --git a/docs/manual/rewrite/flags.html.en b/docs/manual/rewrite/flags.html.en new file mode 100644 index 0000000000..add1212626 --- /dev/null +++ b/docs/manual/rewrite/flags.html.en @@ -0,0 +1,174 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><!-- + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + This file is generated from xml source: DO NOT EDIT + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + --> +<title>Apache mod_rewrite Flags - Apache HTTP Server</title> +<link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" /> +<link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" /> +<link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /> +<link href="../images/favicon.ico" rel="shortcut icon" /></head> +<body id="manual-page"><div id="page-header"> +<p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p> +<p class="apache">Apache HTTP Server Version 2.3</p> +<img alt="" src="../images/feather.gif" /></div> +<div class="up"><a href="./index.html"><img title="<-" alt="<-" src="../images/left.gif" /></a></div> +<div id="path"> +<a href="http://www.apache.org/">Apache</a> > <a href="http://httpd.apache.org/">HTTP Server</a> > <a href="http://httpd.apache.org/docs/">Documentation</a> > <a href="../">Version 2.3</a></div><div id="page-content"><div id="preamble"><h1>Apache mod_rewrite Flags</h1> +<div class="toplang"> +<p><span>Available Languages: </span><a href="../en/rewrite/flags.html" title="English"> en </a></p> +</div> + +<p>This document discusses the flags which are available to the +<code class="directive"><a href="../mod/mod_rewrite.html#rewriterule">RewriteRule</a></code> directive, +providing more detailed explanations and examples of each.</p> +</div> +<div id="quickview"><ul id="toc"><li><img alt="" src="../images/down.gif" /> <a href="#introduction">Introduction</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#flags">The flags</a></li> +</ul><h3>See also</h3><ul class="seealso"><li><a href="../mod/mod_rewrite.html">Module documentation</a></li><li><a href="rewrite_tech.html">Technical details</a></li><li><a href="rewrite_guide.html">Practical solutions to common +problems</a></li><li><a href="rewrite_guide_advanced.html">Practical solutions to +advanced problems</a></li></ul></div> +<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="introduction" id="introduction">Introduction</a></h2> +<p><code class="directive"><a href="../mod/mod_rewrite.html#rewriterule">RewriteRule</a></code>s 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.</p> +</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="flags" id="flags">The flags</a></h2> + +<p>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.</p> + +<p>Presented here are each of the available flags, along with an example +of how you might use them.</p> + +<h3><a name="flag_c" id="flag_c">C|chain</a></h3> +<p>The [C] or [chain] flag indicates that the <code class="directive"><a href="../mod/mod_rewrite.html#rewriterule">RewriteRule</a></code> 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.</p> + + + +<h3><a name="flag_co" id="flag_co">CO|cookie</a></h3> +<p>The [CO], or [cookie] flag, allows you to set a cookie when a +particular <code class="directive"><a href="../mod/mod_rewrite.html#rewriterule">RewriteRule</a></code> +matches. The argument consists of three required fields and two optional +fields.</p> +<p>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.</p> +<p>By default, the lifetime of the cookie is the current browser +session.</p> +<p>By default, the path for which the cookie will be valid is "/" - that +is, the entire website.</p> +<p>Several examples are offered here:</p> + +<div class="example"><p><code> +RewriteEngine On<br /> +RewriteRule ^/index.html - [CO=frontdoor=yes:.apache.org:1440:/] +</code></p></div> + +<p>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 <code>.apache.org</code> domain. It will be set to expire in 1440 +minutes (24 hours) and will be returned for all URIs.</p> + + + +<h3><a name="flag_e" id="flag_e">E|env</a></h3> +<p>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 <code class="directive"><a href="../mod/mod_rewrite.html#rewriterule">RewriteRule</a></code> won't work, since it will +be changed afterwards.</p> + +<p>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.</p> + +<div class="example"><p><code> +RewriteRule %{REQUEST_URI} \.(png|gif|jpg) - [E=image:1]<br /> +CustomLog logs/access_log combined env=!image +</code></p></div> + +<p>Note that this same effect can be obtained using <code class="directive"><a href="../mod/mod_setenvif.html#setenvif">SetEnvIf</a></code>. This technique is offered as +an example, not as a recommendation.</p> + + +<h3><a name="flag_f" id="flag_f">F|forbidden</a></h3> +<p>Forbidden flag</p> + + +<h3><a name="flag_g" id="flag_g">G|gone</a></h3> +<p>Forbidden flag</p> + + +<h3><a name="flag_h" id="flag_h">H|handler</a></h3> +<p>Handler flag</p> + + +<h3><a name="flag_l" id="flag_l">L|last</a></h3> +<p>Last flag</p> + + +<h3><a name="flag_n" id="flag_n">N|next</a></h3> +<p>Next round flag</p> + + +<h3><a name="flag_nc" id="flag_nc">NC|nocase</a></h3> +<p>No case flag</p> + + +<h3><a name="flag_ne" id="flag_ne">NE|noescape</a></h3> +<p>No escape flag</p> + + +<h3><a name="flag_ns" id="flag_ns">NS|nosubreq</a></h3> +<p>No internal subrequest flag</p> + + +<h3><a name="flag_p" id="flag_p">P|proxy</a></h3> +<p>Proxy flag</p> + + +<h3><a name="flag_pt" id="flag_pt">PT|passthrough</a></h3> +<p>Passthrough flag</p> + + +<h3><a name="flag_pt" id="flag_pt">PT|passthrough</a></h3> +<p>Passthrough flag</p> + + +<h3><a name="flag_qsa" id="flag_qsa">QSA|qsappend</a></h3> +<p>Query String Append flag</p> + + +<h3><a name="flag_r" id="flag_r">R|redirect</a></h3> +<p>Redirect flag</p> + + +<h3><a name="flag_s" id="flag_s">S|skip</a></h3> +<p>Skip flag</p> + + +<h3><a name="flag_t" id="flag_t">T|type</a></h3> +<p>Type flag</p> + + +</div></div> +<div class="bottomlang"> +<p><span>Available Languages: </span><a href="../en/rewrite/flags.html" title="English"> en </a></p> +</div><div id="footer"> +<p class="apache">Copyright 1995-2006 The Apache Software Foundation or its licensors, as applicable.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p> +<p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div> +</body></html>
\ No newline at end of file diff --git a/docs/manual/rewrite/flags.xml b/docs/manual/rewrite/flags.xml new file mode 100644 index 0000000000..d3ffaf61a7 --- /dev/null +++ b/docs/manual/rewrite/flags.xml @@ -0,0 +1,187 @@ +<?xml version='1.0' encoding='UTF-8' ?> +<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd"> +<?xml-stylesheet type="text/xsl" href="../style/manual.en.xsl"?> +<!-- $LastChangedRevision: 158972 $ --> + +<!-- + Copyright 2002-2005 The Apache Software Foundation or its licensors, as + applicable. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +<manualpage metafile="flags.xml.meta"> +<parentdocument href="./index.html"/> + + <title>Apache mod_rewrite Flags</title> + +<summary> +<p>This document discusses the flags which are available to the +<directive module="mod_rewrite">RewriteRule</directive> directive, +providing more detailed explanations and examples of each.</p> +</summary> + +<seealso><a href="../mod/mod_rewrite.html">Module documentation</a></seealso> +<seealso><a href="rewrite_tech.html">Technical details</a></seealso> +<seealso><a href="rewrite_guide.html">Practical solutions to common +problems</a></seealso> +<seealso><a href="rewrite_guide_advanced.html">Practical solutions to +advanced problems</a></seealso> + +<section id="introduction"><title>Introduction</title> +<p><directive module="mod_rewrite">RewriteRule</directive>s 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.</p> +<example> +RewriteRule pattern target [Flag1,Flag2,Flag3] +</example> + +<p>The flags all have a short form, such as <code>CO</code>, as well as +a longer form, such as <code>cookie</code>. Some flags take one or more +arguments. Flags are not case sensitive.</p> + +</section> + +<section id="flags"><title>The flags</title> + +<p>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.</p> + +<p>Presented here are each of the available flags, along with an example +of how you might use them.</p> + +<section id="flag_c"><title>C|chain</title> +<p>The [C] or [chain] flag indicates that the <directive +module="mod_rewrite">RewriteRule</directive> 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.</p> + +</section> + +<section id="flag_co"><title>CO|cookie</title> +<p>The [CO], or [cookie] flag, allows you to set a cookie when a +particular <directive module="mod_rewrite">RewriteRule</directive> +matches. The argument consists of three required fields and two optional +fields.</p> +<p>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.</p> +<p>By default, the lifetime of the cookie is the current browser +session.</p> +<p>By default, the path for which the cookie will be valid is "/" - that +is, the entire website.</p> +<p>Several examples are offered here:</p> + +<example> +RewriteEngine On<br /> +RewriteRule ^/index.html - [CO=frontdoor=yes:.apache.org:1440:/] +</example> + +<p>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 <code>.apache.org</code> domain. It will be set to expire in 1440 +minutes (24 hours) and will be returned for all URIs.</p> + +</section> + +<section id="flag_e"><title>E|env</title> +<p>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 <directive +module="mod_rewrite">RewriteRule</directive> won't work, since it will +be changed afterwards.</p> + +<p>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.</p> + +<example> +RewriteRule %{REQUEST_URI} \.(png|gif|jpg) - [E=image:1]<br /> +CustomLog logs/access_log combined env=!image +</example> + +<p>Note that this same effect can be obtained using <directive +module="mod_setenvif">SetEnvIf</directive>. This technique is offered as +an example, not as a recommendation.</p> +</section> + +<section id="flag_f"><title>F|forbidden</title> +<p>Forbidden flag</p> +</section> + +<section id="flag_g"><title>G|gone</title> +<p>Gone flag</p> +</section> + +<section id="flag_h"><title>H|handler</title> +<p>Handler flag</p> +</section> + +<section id="flag_l"><title>L|last</title> +<p>Last flag</p> +</section> + +<section id="flag_n"><title>N|next</title> +<p>Next round flag</p> +</section> + +<section id="flag_nc"><title>NC|nocase</title> +<p>No case flag</p> +</section> + +<section id="flag_ne"><title>NE|noescape</title> +<p>No escape flag</p> +</section> + +<section id="flag_ns"><title>NS|nosubreq</title> +<p>No internal subrequest flag</p> +</section> + +<section id="flag_p"><title>P|proxy</title> +<p>Proxy flag</p> +</section> + +<section id="flag_pt"><title>PT|passthrough</title> +<p>Passthrough flag</p> +</section> + +<section id="flag_pt"><title>PT|passthrough</title> +<p>Passthrough flag</p> +</section> + +<section id="flag_qsa"><title>QSA|qsappend</title> +<p>Query String Append flag</p> +</section> + +<section id="flag_r"><title>R|redirect</title> +<p>Redirect flag</p> +</section> + +<section id="flag_s"><title>S|skip</title> +<p>Skip flag</p> +</section> + +<section id="flag_t"><title>T|type</title> +<p>Type flag</p> +</section> + +</section> +</manualpage> + diff --git a/docs/manual/rewrite/flags.xml.meta b/docs/manual/rewrite/flags.xml.meta new file mode 100644 index 0000000000..c01b41186c --- /dev/null +++ b/docs/manual/rewrite/flags.xml.meta @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8" ?> + +<metafile> + <basename>flags</basename> + <path>/rewrite/</path> + <relpath>..</relpath> + + <variants> + <variant>en</variant> + </variants> +</metafile> |