]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
xforms
authorDaniel Gruno <humbedooh@apache.org>
Thu, 19 Jul 2012 15:07:53 +0000 (15:07 +0000)
committerDaniel Gruno <humbedooh@apache.org>
Thu, 19 Jul 2012 15:07:53 +0000 (15:07 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@1363365 13f79535-47bb-0310-9956-ffa450edef68

docs/manual/rewrite/advanced.html.en
docs/manual/rewrite/flags.html.en
docs/manual/rewrite/flags.xml.fr
docs/manual/rewrite/intro.html.en
docs/manual/rewrite/intro.html.fr
docs/manual/rewrite/intro.xml.fr
docs/manual/rewrite/intro.xml.meta

index 3fe073071c1442a87e85e041950a35ac31202fd9..b94b519076c9eb8ede8274e6bd28a1e5055d36a2 100644 (file)
@@ -25,8 +25,8 @@
 </div>
 
 
-<p>This document supplements the <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code> 
-<a href="../mod/mod_rewrite.html">reference documentation</a>. It provides 
+<p>This document supplements the <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code>
+<a href="../mod/mod_rewrite.html">reference documentation</a>. It provides
 a few advanced techniques and tricks using mod_rewrite.</p>
 
 <div class="warning">Note that many of these examples won't work unchanged in your
@@ -54,8 +54,8 @@ configuration.</div>
     <dt>Description:</dt>
 
     <dd>
-      <p>A common technique for distributing the burden of 
-      server load or storage space is called "sharding". 
+      <p>A common technique for distributing the burden of
+      server load or storage space is called "sharding".
       When using this method, a front-end server will use the
       url to consistently "shard" users or objects to separate
       backend servers.</p>
@@ -101,6 +101,9 @@ RewriteRule   ^/u/<strong>([^/]+)</strong>/?(.*)   http://<strong>${users-to-hos
     </dd>
   </dl>
 
+  <p>See the <code class="directive"><a href="../mod/mod_rewrite.html#rewritemap">RewriteMap</a></code>
+  documentation for more discussion of the syntax of this directive.</p>
+
 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
 <div class="section">
 <h2><a name="on-the-fly-content" id="on-the-fly-content">On-the-fly Content-Regeneration</a></h2>
@@ -123,22 +126,25 @@ RewriteRule   ^/u/<strong>([^/]+)</strong>/?(.*)   http://<strong>${users-to-hos
     <dd>
       This is done via the following ruleset:
 
-<div class="example"><p><code>
-# This example is valid in per-directory context only<br />
-RewriteCond %{REQUEST_FILENAME}   <strong>!-s</strong><br />
-RewriteRule ^page\.<strong>html</strong>$          page.<strong>cgi</strong>   [T=application/x-httpd-cgi,L]
-</code></p></div>
-
-      <p>Here a request for <code>page.html</code> leads to an
-      internal run of a corresponding <code>page.cgi</code> if
-      <code>page.html</code> is missing or has filesize
-      null. The trick here is that <code>page.cgi</code> is a
-      CGI script which (additionally to its <code>STDOUT</code>)
-      writes its output to the file <code>page.html</code>.
-      Once it has completed, the server sends out
-      <code>page.html</code>. When the webmaster wants to force
-      a refresh of the contents, he just removes
-      <code>page.html</code> (typically from <code>cron</code>).</p>
+<pre class="prettyprint lang-config">
+# This example is valid in per-directory context only
+RewriteCond %{REQUEST_URI}   !-U
+RewriteRule ^(.+)\.html$          /regenerate_page.cgi   [PT,L]
+</pre>
+
+
+    <p>The <code>-U</code> operator determines whether the test string
+    (in this case, <code>REQUEST_URI</code>) is a valid URL. It does
+    this via a subrequest. In the event that this subrequest fails -
+    that is, the requested resource doesn't exist - this rule invokes
+    the CGI program <code>/regenerate_page.cgi</code>, which generates
+    the requested resource and saves it into the document directory, so
+    that the next time it is requested, a static copy can be served.</p>
+
+    <p>In this way, documents that are infrequently updated can be served in
+    static form. if documents need to be refreshed, they can be deleted
+    from the document directory, and they will then be regenerated the
+    next time they are requested.</p>
     </dd>
   </dl>
 
@@ -245,61 +251,61 @@ RewriteRule   ^(/[uge]/[^/]+/?.*):refresh  /internal/cgi/apache/nph-refresh?f=$1
 $| = 1;
 
 #   split the QUERY_STRING variable
-@pairs = split(/&amp;/, $ENV{'QUERY_STRING'});
+@pairs = split( /&amp;/, $ENV{'QUERY_STRING'} );
 foreach $pair (@pairs) {
-($name, $value) = split(/=/, $pair);
-$name =~ tr/A-Z/a-z/;
-$name = 'QS_' . $name;
-$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
-eval "\$$name = \"$value\"";
+    ( $name, $value ) = split( /=/, $pair );
+    $name =~ tr/A-Z/a-z/;
+    $name = 'QS_' . $name;
+    $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
+    eval "\$$name = \"$value\"";
 }
-$QS_s = 1 if ($QS_s eq '');
-$QS_n = 3600 if ($QS_n eq '');
-if ($QS_f eq '') {
-print "HTTP/1.0 200 OK\n";
-print "Content-type: text/html\n\n";
+$QS_s = 1    if ( $QS_s eq '' );
+$QS_n = 3600 if ( $QS_n eq '' );
+if ( $QS_f eq '' ) {
+    print "HTTP/1.0 200 OK\n";
+    print "Content-type: text/html\n\n";
 print "&amp;lt;b&amp;gt;ERROR&amp;lt;/b&amp;gt;: No file given\n";
-exit(0);
+    exit(0);
 }
-if (! -f $QS_f) {
-print "HTTP/1.0 200 OK\n";
-print "Content-type: text/html\n\n";
+if ( !-f $QS_f ) {
+    print "HTTP/1.0 200 OK\n";
+    print "Content-type: text/html\n\n";
 print "&amp;lt;b&amp;gt;ERROR&amp;lt;/b&amp;gt;: File $QS_f not found\n";
-exit(0);
+    exit(0);
 }
 
 sub print_http_headers_multipart_begin {
-print "HTTP/1.0 200 OK\n";
-$bound = "ThisRandomString12345";
-print "Content-type: multipart/x-mixed-replace;boundary=$bound\n";
-&amp;print_http_headers_multipart_next;
+    print "HTTP/1.0 200 OK\n";
+    $bound = "ThisRandomString12345";
+    print "Content-type: multipart/x-mixed-replace;boundary=$bound\n";
+    &amp;print_http_headers_multipart_next;
 }
 
 sub print_http_headers_multipart_next {
-print "\n--$bound\n";
+    print "\n--$bound\n";
 }
 
 sub print_http_headers_multipart_end {
-print "\n--$bound--\n";
+    print "\n--$bound--\n";
 }
 
 sub displayhtml {
-local($buffer) = @_;
-$len = length($buffer);
-print "Content-type: text/html\n";
-print "Content-length: $len\n\n";
-print $buffer;
+    local ($buffer) = @_;
+    $len = length($buffer);
+    print "Content-type: text/html\n";
+    print "Content-length: $len\n\n";
+    print $buffer;
 }
 
 sub readfile {
-local($file) = @_;
-local(*FP, $size, $buffer, $bytes);
-($x, $x, $x, $x, $x, $x, $x, $size) = stat($file);
-$size = sprintf("%d", $size);
+    local ($file) = @_;
+    local ( *FP, $size, $buffer, $bytes );
+    ( $x, $x, $x, $x, $x, $x, $x, $size ) = stat($file);
+    $size = sprintf( "%d", $size );
 open(FP, "&amp;lt;$file");
-$bytes = sysread(FP, $buffer, $size);
-close(FP);
-return $buffer;
+    $bytes = sysread( FP, $buffer, $size );
+    close(FP);
+    return $buffer;
 }
 
 $buffer = &amp;readfile($QS_f);
@@ -307,30 +313,30 @@ $buffer = &amp;readfile($QS_f);
 &amp;displayhtml($buffer);
 
 sub mystat {
-local($file) = $_[0];
-local($time);
+    local ($file) = $_[0];
+    local ($time);
 
-($x, $x, $x, $x, $x, $x, $x, $x, $x, $mtime) = stat($file);
-return $mtime;
+    ( $x, $x, $x, $x, $x, $x, $x, $x, $x, $mtime ) = stat($file);
+    return $mtime;
 }
 
 $mtimeL = &amp;mystat($QS_f);
-$mtime = $mtime;
-for ($n = 0; $n &amp;lt; $QS_n; $n++) {
-while (1) {
-    $mtime = &amp;mystat($QS_f);
-    if ($mtime ne $mtimeL) {
-        $mtimeL = $mtime;
-        sleep(2);
-        $buffer = &amp;readfile($QS_f);
-        &amp;print_http_headers_multipart_next;
-        &amp;displayhtml($buffer);
-        sleep(5);
-        $mtimeL = &amp;mystat($QS_f);
-        last;
+$mtime  = $mtime;
+for ( $n = 0 ; $n &amp; lt ; $QS_n ; $n++ ) {
+    while (1) {
+        $mtime = &amp;mystat($QS_f);
+        if ( $mtime ne $mtimeL ) {
+            $mtimeL = $mtime;
+            sleep(2);
+            $buffer = &amp;readfile($QS_f);
+            &amp;print_http_headers_multipart_next;
+            &amp;displayhtml($buffer);
+            sleep(5);
+            $mtimeL = &amp;mystat($QS_f);
+            last;
+        }
+        sleep($QS_s);
     }
-    sleep($QS_s);
-}
 }
 
 &amp;print_http_headers_multipart_end;
@@ -399,7 +405,7 @@ RewriteRule   ^/~(<strong>([a-z])</strong>[a-z0-9]+)(.*)  /home/<strong>$2</stro
     </dd>
 
     <dt>Discussion:</dt>
-    <dd>This technique will of course also work with other 
+    <dd>This technique will of course also work with other
     special characters that mod_rewrite, by default, URL-encodes.</dd>
   </dl>
 
index f3e7919bf9ae43d33e45c1d4904fc163dcf230e0..23f0f26d2abe7f43434db0467d05cfb5046c15fe 100644 (file)
@@ -49,7 +49,7 @@ providing detailed explanations and examples.</p>
 <li><img alt="" src="../images/down.gif" /> <a href="#flag_r">R|redirect</a></li>
 <li><img alt="" src="../images/down.gif" /> <a href="#flag_s">S|skip</a></li>
 <li><img alt="" src="../images/down.gif" /> <a href="#flag_t">T|type</a></li>
-</ul><h3>See also</h3><ul class="seealso"><li><a href="../mod/mod_rewrite.html">Module documentation</a></li><li><a href="intro.html">mod_rewrite introduction</a></li><li><a href="remapping.html">Redirection and remapping</a></li><li><a href="access.html">Controlling access</a></li><li><a href="vhosts.html">Virtual hosts</a></li><li><a href="proxy.html">Proxying</a></li><li><a href="rewritemap.html">Using RewriteMap</a></li><li><a href="advanced.html">Advanced techniques and tricks</a></li><li><a href="avoid.html">When not to use mod_rewrite</a></li></ul><ul class="seealso"><li><a href="#comments_section">Comments</a></li></ul></div>
+</ul><h3>See also</h3><ul class="seealso"><li><a href="../mod/mod_rewrite.html">Module documentation</a></li><li><a href="intro.html">mod_rewrite introduction</a></li><li><a href="remapping.html">Redirection and remapping</a></li><li><a href="access.html">Controlling access</a></li><li><a href="vhosts.html">Virtual hosts</a></li><li><a href="proxy.html">Proxying</a></li><li><a href="rewritemap.html">Using RewriteMap</a></li><li><a href="advanced.html">Advanced techniques</a></li><li><a href="avoid.html">When not to use mod_rewrite</a></li></ul><ul class="seealso"><li><a href="#comments_section">Comments</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>
@@ -65,7 +65,7 @@ RewriteRule pattern target [Flag1,Flag2,Flag3]
 a longer form, such as <code>cookie</code>. Some flags take one or more
 arguments. Flags are not case sensitive.</p>
 
-<p>Each flag (with a few exceptions) 
+<p>Each flag (with a few exceptions)
 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>
@@ -89,15 +89,22 @@ so backreferences will be unescaped at the time they are applied.
 Using the B flag, non-alphanumeric characters in backreferences
 will be escaped. For example, consider the rule:</p>
 
-<div class="example"><p><code>
-RewriteRule ^(/.*)$ /index.php?show=$1
-</code></p></div>
+<pre class="prettyprint lang-config">RewriteRule ^search/(.*)$ /search.php?term=$1</pre>
+
+
+<p>Given a search term of 'x &amp; y/z', a browser will encode it as
+'x%20%26%20y%2Fz', making the request 'search/x%20%26%20y%2Fz'. Without the B
+flag, this rewrite rule will map to 'search.php?term=x &amp; y/z', which
+isn't a valid URL, and so would be encoded as
+<code>search.php?term=x%20&amp;y%2Fz=</code>, which is not what was intended.</p>
 
-<p>This will map <code>/C++</code> to
-<code>/index.php?show=/C++</code>. But it will also map
-<code>/C%2b%2b</code> to <code>/index.php?show=/C++</code>, because
-the <code>%2b</code> has been unescaped.  With the B flag, it will
-instead map to <code>/index.php?show=/C%2b%2b</code>.</p>
+<p>With the B flag set on this same rule, the parameters are re-encoded
+before being passed on to the output URL, resulting in a correct mapping to
+<code>/search.php?term=x%20%26%20y%2Fz</code>.</p>
+
+<p>Note that you may also need to set <code class="directive"><a href="../mod/core.html#allowencodedslashes">AllowEncodedSlashes</a></code> to <code>On</code> to get this
+particular example to work, as httpd does not allow encoded slashes in URLs, and
+returns a 404 if it sees one.</p>
 
 <p>This escaping is particularly necessary in a proxy situation,
 when the backend may break if presented with an unescaped URL.</p>
@@ -141,7 +148,6 @@ security model.</dd>
 <p>You may optionally also set the following values:</p>
 
 <dl>
-
 <dt>Lifetime</dt>
 <dd>The time for which the cookie will persist, in minutes.</dd>
 <dd>A value of 0 indicates that the cookie will persist only for the
@@ -343,13 +349,13 @@ C. Use this flag to indicate that the current rule should be applied
 immediately without considering further rules.</p>
 
 <p>If you are using <code class="directive"><a href="../mod/mod_rewrite.html#rewriterule">RewriteRule</a></code> in either
-<code>.htaccess</code> files or in 
+<code>.htaccess</code> files or in
 <code class="directive"><a href="../mod/core.html#directory">&lt;Directory&gt;</a></code> 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 <code>.htaccess</code> file or 
+request is handled, the <code>.htaccess</code> file or
 <code class="directive"><a href="../mod/core.html#directory">&lt;Directory&gt;</a></code> 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
@@ -363,7 +369,7 @@ rules, as shown below.</p>
 
 <p>The example given here will rewrite any request to
 <code>index.php</code>, giving the original request as a query string
-argument to <code>index.php</code>, however, the <code class="directive"><a href="../mod/mod_rewrite.html#rewritecond">RewriteCond</a></code> ensures that if the request 
+argument to <code>index.php</code>, however, the <code class="directive"><a href="../mod/mod_rewrite.html#rewritecond">RewriteCond</a></code> ensures that if the request
 is already for <code>index.php</code>, the <code class="directive"><a href="../mod/mod_rewrite.html#rewriterule">RewriteRule</a></code> will be skipped.</p>
 
 <div class="example"><p><code>
@@ -443,7 +449,7 @@ On subrequests, it is not always useful, and can even cause errors, if
 the complete set of rules are applied. Use this flag to exclude
 problematic rules.</p>
 
-<p>To decide whether or not to use this rule: if you prefix URLs with 
+<p>To decide whether or not to use this rule: if you prefix URLs with
 CGI-scripts, to force them to be processed by the CGI-script, it's
 likely that you will run into problems (or significant overhead)
 on sub-requests. In these cases, use this flag.</p>
@@ -498,15 +504,15 @@ 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 treated
 as a URI instead. That is to say, the
 use of the [PT] flag causes the result of the <code class="directive"><a href="../mod/mod_rewrite.html#rewriterule">RewriteRule</a></code> to be passed back through
-URL mapping, so that location-based mappings, such as <code class="directive"><a href="../mod/mod_alias.html#alias">Alias</a></code>, <code class="directive"><a href="../mod/mod_alias.html#redirect">Redirect</a></code>, or <code class="directive"><a href="../mod/mod_alias.html#scriptalias">ScriptAlias</a></code>, for example, might have a 
+URL mapping, so that location-based mappings, such as <code class="directive"><a href="../mod/mod_alias.html#alias">Alias</a></code>, <code class="directive"><a href="../mod/mod_alias.html#redirect">Redirect</a></code>, or <code class="directive"><a href="../mod/mod_alias.html#scriptalias">ScriptAlias</a></code>, for example, might have a
 chance to take effect.
 </p>
 
 <p>
-If, for example, you have an 
+If, for example, you have an
 <code class="directive"><a href="../mod/mod_alias.html#alias">Alias</a></code>
 for /icons, and have a <code class="directive"><a href="../mod/mod_rewrite.html#rewriterule">RewriteRule</a></code> pointing there, you should
-use the [PT] flag to ensure that the 
+use the [PT] flag to ensure that the
 <code class="directive"><a href="../mod/mod_alias.html#alias">Alias</a></code> is evaluated.
 </p>
 
@@ -564,8 +570,8 @@ will be used to generate the URL sent with the redirect.
 </p>
 
 <p>
-<em>Any</em> valid HTTP response  status code may be specified, 
-using the syntax [R=305], with a 302 status code being used by 
+<em>Any</em> valid HTTP response  status code may be specified,
+using the syntax [R=305], with a 302 status code being used by
 default if none is specified. The status code specified need not
 necessarily be a redirect (3xx) status code. However, 
 if a status code is outside the redirect range (300-399) then the
@@ -573,7 +579,7 @@ substitution string is dropped entirely, and rewriting is stopped as if
 the <code>L</code> were used.</p>
 
 <p>In addition to response status codes, you may also specify redirect
-status using their symbolic names: <code>temp</code> (default), 
+status using their symbolic names: <code>temp</code> (default),
 <code>permanent</code>, or <code>seeother</code>.</p>
 
 <p>
@@ -587,21 +593,23 @@ URI in request' warnings.
 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
 <div class="section">
 <h2><a name="flag_s" id="flag_s">S|skip</a></h2>
-<p>The [S] flag is used to skip rules that you don't want to run. This
-can be thought of as a <code>goto</code> statement in your rewrite
-ruleset. In the following example, we only want to run the <code class="directive"><a href="../mod/mod_rewrite.html#rewriterule">RewriteRule</a></code> if the requested URI
-doesn't correspond with an actual file.</p>
-
-<div class="example"><p><code>
-# Is the request for a non-existent file?<br />
-RewriteCond %{REQUEST_FILENAME} !-f<br />
-RewriteCond %{REQUEST_FILENAME} !-d<br />
-# If so, skip these two RewriteRules<br />
-RewriteRule .? - [S=2]<br />
-<br />
-RewriteRule (.*\.gif) images.php?$1<br />
+<p>The [S] flag is used to skip rules that you don't want to run. The 
+syntax of the skip flag is [S=<em>N</em>], where <em>N</em> signifies 
+the number of rules to skip. This can be thought of as a <code>goto</code> 
+statement in your rewrite ruleset. In the following example, we only want 
+to run the <code class="directive"><a href="../mod/mod_rewrite.html#rewriterule">RewriteRule</a></code> if the 
+requested URI doesn't correspond with an actual file.</p>
+
+<pre class="prettyprint lang-config">
+# Is the request for a non-existent file?
+RewriteCond %{REQUEST_FILENAME} !-f
+RewriteCond %{REQUEST_FILENAME} !-d
+# If so, skip these two RewriteRules
+RewriteRule .? - [S=2]
+RewriteRule (.*\.gif) images.php?$1
 RewriteRule (.*\.html) docs.php?$1
-</code></p></div>
+</pre>
+
 
 <p>This technique is useful because a <code class="directive"><a href="../mod/mod_rewrite.html#rewritecond">RewriteCond</a></code> only applies to the
 <code class="directive"><a href="../mod/mod_rewrite.html#rewriterule">RewriteRule</a></code> immediately
@@ -620,14 +628,14 @@ RewriteRule .? - [S=3]<br />
 <br />
 # IF the file exists, then:
 <span class="indent">
-       RewriteRule (.*\.gif) images.php?$1<br />
-       RewriteRule (.*\.html) docs.php?$1<br />
-       # Skip past the "else" stanza.<br />
-       RewriteRule .? - [S=1]<br />
+        RewriteRule (.*\.gif) images.php?$1<br />
+        RewriteRule (.*\.html) docs.php?$1<br />
+        # Skip past the "else" stanza.<br />
+        RewriteRule .? - [S=1]<br />
 </span>
 # ELSE...
 <span class="indent">
-       RewriteRule (.*) 404.php?file=$1<br />
+        RewriteRule (.*) 404.php?file=$1<br />
 </span>
 # END
 </code></p></div>
@@ -662,10 +670,10 @@ invariably be a less efficient solution than the alternatives.</p>
 
 <p>
 If used in per-directory context, use only <code>-</code> (dash)
-as the substitution <em>for the entire round of mod_rewrite processing</em>, 
-otherwise the MIME-type set with this flag is lost due to an internal 
+as the substitution <em>for the entire round of mod_rewrite processing</em>,
+otherwise the MIME-type set with this flag is lost due to an internal
 re-processing (including subsequent rounds of mod_rewrite processing).
-The <code>L</code> flag can be useful in this context to end the 
+The <code>L</code> flag can be useful in this context to end the
 <em>current</em> round of mod_rewrite processing.</p>
 
 </div></div>
index 79d58b2d82bb735c2c54543f35a08b4de66ee3c6..0ad2eedc016e32139cc864c594ba5287c356fb60 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="ISO-8859-1" ?>
 <!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
 <?xml-stylesheet type="text/xsl" href="../style/manual.fr.xsl"?>
-<!-- English Revision: 1307737:1346292 (outdated) -->
+<!-- English Revision: 1307737:1363364 (outdated) -->
 <!-- French translation : Lucien GENTIS -->
 <!-- Reviewed by : Vincent Deffontaines -->
 
index 7bb3fce394a73c48378798e6841c59e10a72d49a..5edc9eb3366258e5f036e996d2f57db170bb76dd 100644 (file)
@@ -39,7 +39,7 @@ but this doc should help the beginner get their feet wet.
 <li><img alt="" src="../images/down.gif" /> <a href="#rewritecond">Rewrite Conditions</a></li>
 <li><img alt="" src="../images/down.gif" /> <a href="#rewritemap">Rewrite maps</a></li>
 <li><img alt="" src="../images/down.gif" /> <a href="#htaccess">.htaccess files</a></li>
-</ul><h3>See also</h3><ul class="seealso"><li><a href="../mod/mod_rewrite.html">Module documentation</a></li><li><a href="remapping.html">Redirection and remapping</a></li><li><a href="access.html">Controlling access</a></li><li><a href="vhosts.html">Virtual hosts</a></li><li><a href="proxy.html">Proxying</a></li><li><a href="rewritemap.html">Using RewriteMap</a></li><li><a href="advanced.html">Advanced techniques and tricks</a></li><li><a href="avoid.html">When not to use mod_rewrite</a></li></ul><ul class="seealso"><li><a href="#comments_section">Comments</a></li></ul></div>
+</ul><h3>See also</h3><ul class="seealso"><li><a href="../mod/mod_rewrite.html">Module documentation</a></li><li><a href="remapping.html">Redirection and remapping</a></li><li><a href="access.html">Controlling access</a></li><li><a href="vhosts.html">Virtual hosts</a></li><li><a href="proxy.html">Proxying</a></li><li><a href="rewritemap.html">Using RewriteMap</a></li><li><a href="advanced.html">Advanced techniques</a></li><li><a href="avoid.html">When not to use mod_rewrite</a></li></ul><ul class="seealso"><li><a href="#comments_section">Comments</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>
@@ -103,7 +103,7 @@ well as write your own.</p>
 character</td><td><code>c.t</code> will match <code>cat</code>,
 <code>cot</code>, <code>cut</code>, etc.</td></tr>
 <tr><td><code>+</code></td><td>Repeats the previous match one or more
-times</td><td><code>a+</code> matches <code>a</code>, <code>aa</code>, 
+times</td><td><code>a+</code> matches <code>a</code>, <code>aa</code>,
 <code>aaa</code>, etc</td></tr>
 <tr><td><code>*</code></td><td>Repeats the previous match zero or more
 times.</td><td><code>a*</code> matches all the same things
@@ -118,7 +118,7 @@ of the string</td><td><code>^a</code> matches a string that begins with
 the string.</td><td><code>a$</code> matches a string that ends with
 <code>a</code>.</td></tr>
 <tr><td><code>( )</code></td><td>Groups several characters into a single
-unit, and captures a match for use in a backreference.</td><td><code>(ab)+</code> 
+unit, and captures a match for use in a backreference.</td><td><code>(ab)+</code>
 matches <code>ababab</code> - that is, the <code>+</code> applies to the group.
 For more on backreferences see <a href="#InternalBackRefs">below</a>.</td></tr>
 <tr><td><code>[ ]</code></td><td>A character class - matches one of the
@@ -141,14 +141,19 @@ the expression.</p>
       <em>CondPattern</em>, back-references are internally created
       which can be used with the strings <code>$N</code> and
       <code>%N</code> (see below). These are available for creating
-      the strings <em>Substitution</em> and <em>TestString</em>.
-      Figure 1 shows to which locations the back-references are
-      transferred for expansion as well as illustrating the flow of the
-      RewriteRule, RewriteCond matching.</p>
+      the strings <em>Substitution</em> and <em>TestString</em> as 
+      outlined in the following chapters. Figure 1 shows to which 
+      locations the back-references are transferred for expansion as 
+      well as illustrating the flow of the RewriteRule, RewriteCond 
+      matching. In the next chapters, we will be exploring how to use 
+      these back-references, so do not fret if it seems a bit alien 
+      to you at first.
+      </p>
 
 <p class="figure">
-      <img src="../images/rewrite_rule_flow.png" alt="Flow of RewriteRule and RewriteCond matching" /><br />
-      <dfn>Figure 1:</dfn> The back-reference flow through a rule.
+      <img src="../images/rewrite_backreferences.png" alt="Flow of RewriteRule and RewriteCond matching" /><br />
+      <dfn>Figure 1:</dfn> The back-reference flow through a rule.<br />
+      In this example, a request for <code>/test/1234</code> would be transformed into <code>/admin.foo?page=test&amp;id=1234&amp;host=admin.example.com</code>.
 </p>
 
 
@@ -163,10 +168,15 @@ of three arguments separated by spaces. The arguments are</p>
 <li><var>[flags]</var>: options affecting the rewritten request.</li>
 </ol>
 
-<p>The <var>Pattern</var> is always a <a href="#regex">regular
-expression</a> matched against the URL-Path of the incoming request
-(the part after the hostname but before any question mark indicating
-the beginning of a query string).</p>
+<p>The <var>Pattern</var> is a <a href="#regex">regular expression</a>. 
+It is initially (for the first rewrite rule or until a substitution occurs) 
+matched against the URL-path of the incoming request (the part after the 
+hostname but before any question mark indicating the beginning of a query 
+string) or, in per-directory context, against the request's path relative 
+to the directory for which the rule is defined. Once a substitution has 
+occured, the rules that follow are matched against the substituted
+value.
+</p>
 
 <p class="figure">
       <img src="../images/syntax_rewriterule.png" alt="Syntax of the RewriteRule directive" /><br />
index 2c145c4aa6a293f147ccedc8f1493508db88d200..b8aaaf7d17816e094e08a891170e25f845e944a7 100644 (file)
@@ -24,6 +24,8 @@
 <p><span>Langues Disponibles: </span><a href="../en/rewrite/intro.html" hreflang="en" rel="alternate" title="English">&nbsp;en&nbsp;</a> |
 <a href="../fr/rewrite/intro.html" title="Français">&nbsp;fr&nbsp;</a></p>
 </div>
+<div class="outofdate">Cette traduction peut être périmée. Vérifiez la version
+            anglaise pour les changements récents.</div>
 
 <p>Ce document est un complément à la <a href="../mod/mod_rewrite.html">documentation de référence</a> du module
 <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code>. Il décrit les concepts de base dont la
index 36d5aaf22cc4a57a8b1e29727e9cc0820e330e2c..eac3eaf98c568df0c37e43a9b3b30d5a73a77897 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="ISO-8859-1" ?>
 <!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
 <?xml-stylesheet type="text/xsl" href="../style/manual.fr.xsl"?>
-<!-- English Revision : 1179182 -->
+<!-- English Revision: 1179182:1363364 (outdated) -->
 <!-- French translation : Lucien GENTIS -->
 <!-- Reviewed by : Vincent Deffontaines -->
 
index 5aaac0fc8675ccc7e032ca6c835170e209509b1d..ce245b2841ca052c89d1608a46eb15c79f469bd8 100644 (file)
@@ -8,6 +8,6 @@
 
   <variants>
     <variant>en</variant>
-    <variant>fr</variant>
+    <variant outdated="yes">fr</variant>
   </variants>
 </metafile>