diff options
author | Ruediger Pluem <rpluem@apache.org> | 2019-11-13 14:23:50 +0100 |
---|---|---|
committer | Ruediger Pluem <rpluem@apache.org> | 2019-11-13 14:23:50 +0100 |
commit | 9a81a381460aab9d790f04b842ce485c7e7bbec8 (patch) | |
tree | ae8b3fbd1000c5c262cd2b5ed409fd6a8b18a9c4 /docs/manual/rewrite | |
parent | Test IRC and e-mail notifications. (diff) | |
download | apache2-9a81a381460aab9d790f04b842ce485c7e7bbec8.tar.xz apache2-9a81a381460aab9d790f04b842ce485c7e7bbec8.zip |
* Rebuild docs
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1869738 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'docs/manual/rewrite')
-rw-r--r-- | docs/manual/rewrite/advanced.html.en | 9 | ||||
-rw-r--r-- | docs/manual/rewrite/intro.html.en | 85 |
2 files changed, 65 insertions, 29 deletions
diff --git a/docs/manual/rewrite/advanced.html.en b/docs/manual/rewrite/advanced.html.en index b500e80a32..22136fafa6 100644 --- a/docs/manual/rewrite/advanced.html.en +++ b/docs/manual/rewrite/advanced.html.en @@ -308,10 +308,10 @@ RewriteRule "^foo\.html$" "foo.night.html"</pre> <dt>Description:</dt> <dd> - <p>At time, we want to maintain some kind of status when we + <p>At times, we want to maintain some kind of status when we perform a rewrite. For example, you want to make a note that you've done that rewrite, so that you can check later to see if a - request can via that rewrite. One way to do this is by setting an + request came via that rewrite. One way to do this is by setting an environment variable.</p> </dd> @@ -332,7 +332,10 @@ RewriteRule "^/horse/(.*)" "/pony/$1" [E=<strong>rewritten:1</strong>]</pre> <p>Note that environment variables do not survive an external redirect. You might consider using the [CO] flag to set a - cookie.</p> + cookie. For per-directory and htaccess rewrites, where the final + substitution is processed as an internal redirect, environment + variables from the previous round of rewriting are prefixed with + "REDIRECT_". </p> </dd> </dl> diff --git a/docs/manual/rewrite/intro.html.en b/docs/manual/rewrite/intro.html.en index 02fd0161bf..057ef87329 100644 --- a/docs/manual/rewrite/intro.html.en +++ b/docs/manual/rewrite/intro.html.en @@ -73,7 +73,7 @@ it will tell you exactly how each rule is processed.</p> <div class="section"> <h2><a name="regex" id="regex">Regular Expressions</a> <a title="Permanent link" href="#regex" class="permalink">¶</a></h2> -<p>mod_rewrite uses the <a href="http://pcre.org/">Perl Compatible +<p><code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code> uses the <a href="http://pcre.org/">Perl Compatible Regular Expression</a> vocabulary. In this document, we do not attempt to provide a detailed reference to regular expressions. For that, we recommend the <a href="http://pcre.org/pcre.txt">PCRE man pages</a>, the @@ -101,32 +101,65 @@ well as write your own.</p> <th>Example</th> </tr> -<tr><td><code>.</code></td><td>Matches any single -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>, -<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 -<code>a+</code> matches, but will also match an empty string.</td></tr> -<tr><td><code>?</code></td><td>Makes the match optional.</td><td> -<code>colou?r</code> will match <code>color</code> and <code>colour</code>.</td> +<tr> + <td><code>.</code></td> + <td>Matches any single 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>, + <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 <code>a+</code> matches, + but will also match an empty string</td> +</tr> +<tr> + <td><code>?</code></td> + <td>Makes the match optional</td> + <td><code>colou?r</code> will match <code>color</code> and + <code>colour</code></td> +</tr> +<tr> + <td><code>\</code></td> + <td>Escape the next character</td> + <td><code>\.</code> will match <code>.</code> (dot) and not <em>any single + character</em> as explain above</td> </tr> -<tr><td><code>^</code></td><td>Called an anchor, matches the beginning -of the string</td><td><code>^a</code> matches a string that begins with -<code>a</code></td></tr> -<tr><td><code>$</code></td><td>The other anchor, this matches the end of -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> -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 -characters</td><td><code>c[uoa]t</code> matches <code>cut</code>, -<code>cot</code> or <code>cat</code>.</td></tr> -<tr><td><code>[^ ]</code></td><td>Negative character class - matches any character not specified</td><td><code>c[^/]t</code> matches <code>cat</code> or <code>c=t</code> but not <code>c/t</code></td></tr> +<tr> + <td><code>^</code></td> + <td>Called an anchor, matches the beginning of the string</td> + <td><code>^a</code> matches a string that begins with <code>a</code></td> +</tr> +<tr> + <td><code>$</code></td> + <td>The other anchor, this matches the end of 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> 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 characters</td> + <td><code>c[uoa]t</code> matches <code>cut</code>, <code>cot</code> or + <code>cat</code></td> +</tr> +<tr> + <td><code>[^ ]</code></td> + <td>Negative character class - matches any character not specified</td> + <td><code>c[^/]t</code> matches <code>cat</code> or <code>c=t</code> but + not <code>c/t</code></td></tr> </table> <p>In <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code> the <code>!</code> character can be |