summaryrefslogtreecommitdiffstats
path: root/docs/manual/mod/mod_rewrite.html
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--docs/manual/mod/mod_rewrite.html2
-rw-r--r--docs/manual/mod/mod_rewrite.html.en86
-rw-r--r--docs/manual/mod/mod_rewrite.html.fr.utf882
3 files changed, 145 insertions, 25 deletions
diff --git a/docs/manual/mod/mod_rewrite.html b/docs/manual/mod/mod_rewrite.html
index e5762b9..1d2ff6d 100644
--- a/docs/manual/mod/mod_rewrite.html
+++ b/docs/manual/mod/mod_rewrite.html
@@ -2,7 +2,7 @@
URI: mod_rewrite.html.en
Content-Language: en
-Content-type: text/html; charset=ISO-8859-1
+Content-type: text/html; charset=UTF-8
URI: mod_rewrite.html.fr.utf8
Content-Language: fr
diff --git a/docs/manual/mod/mod_rewrite.html.en b/docs/manual/mod/mod_rewrite.html.en
index 5de13b8..a46bb22 100644
--- a/docs/manual/mod/mod_rewrite.html.en
+++ b/docs/manual/mod/mod_rewrite.html.en
@@ -1,7 +1,7 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
+<?xml version="1.0" encoding="UTF-8"?>
<!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>
-<meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type" />
+<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
<!--
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
This file is generated from xml source: DO NOT EDIT
@@ -27,13 +27,13 @@
<div id="preamble"><h1>Apache Module mod_rewrite</h1>
<div class="toplang">
<p><span>Available Languages: </span><a href="../en/mod/mod_rewrite.html" title="English">&nbsp;en&nbsp;</a> |
-<a href="../fr/mod/mod_rewrite.html" hreflang="fr" rel="alternate" title="Français">&nbsp;fr&nbsp;</a></p>
+<a href="../fr/mod/mod_rewrite.html" hreflang="fr" rel="alternate" title="Français">&nbsp;fr&nbsp;</a></p>
</div>
<table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>Provides a rule-based rewriting engine to rewrite requested
URLs on the fly</td></tr>
<tr><th><a href="module-dict.html#Status">Status:</a></th><td>Extension</td></tr>
-<tr><th><a href="module-dict.html#ModuleIdentifier">Module Identifier:</a></th><td>rewrite_module</td></tr>
-<tr><th><a href="module-dict.html#SourceFile">Source File:</a></th><td>mod_rewrite.c</td></tr></table>
+<tr><th><a href="module-dict.html#ModuleIdentifier">Module Identifier:</a></th><td>rewrite_module</td></tr>
+<tr><th><a href="module-dict.html#SourceFile">Source File:</a></th><td>mod_rewrite.c</td></tr></table>
<h3>Summary</h3>
<p>The <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code> module uses a rule-based rewriting
@@ -364,7 +364,11 @@ AliasMatch "^/myapp" "/opt/myapp-1.2.3"
<dd>The path component of the requested URI,
such as "/index.html". This notably excludes the
query string which is available as its own variable
- named <code>QUERY_STRING</code>.</dd>
+ named <code>QUERY_STRING</code>. The value returned for
+ <code>REQUEST_URI</code>
+ has already been %-decoded, to re-encode it pass it through
+ the "escape" <a href="#mapfunc">mapping-function</a>.
+ </dd>
<dt><code>THE_REQUEST</code></dt>
@@ -531,6 +535,14 @@ AliasMatch "^/myapp" "/opt/myapp-1.2.3"
<em>CondPattern</em>, or is equal to <em>CondPattern</em>
(the two strings are equal, character for character).</dd>
</dl>
+ <div class="note"><h3>Note</h3>
+ The string comparison operator is part of the <em>CondPattern</em>
+ argument and must be included in the quotes if those are used. Eg.
+
+ <pre class="prettyprint lang-config">RewriteCond %{HTTP_USER_AGENT} "=This Robot/1.0"</pre>
+
+ </div>
+
</li>
<li>
@@ -749,6 +761,13 @@ RewriteRule "^/$" "/homepage.std.html" [L]</pre>
the homepage is served. Otherwise, the standard page is served.
</p>
+ <p>By default, multiple <code class="directive">RewriteCond</code>s
+ are evaluated in sequence with an implied logical <strong>AND</strong>.
+ If a condition fails, in the absence of an
+ <strong><code>OR</code></strong> flag, the entire ruleset is abandoned,
+ and further conditions are not evaluated.
+ </p>
+
</div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
@@ -1125,7 +1144,30 @@ matches in per-directory context.</li>
(including their regular expression counterparts), this
should never be necessary and is unsupported. A likely feature
to break in these contexts is relative substitutions.</li>
+
+<li>The <code class="directive"><a href="../mod/core.html#if">If</a></code> blocks
+follow the rules of the <em>directory</em> context.</li>
+
+<li>By default, mod_rewrite overrides rules when <a href="../sections.html#merging">
+merging sections</a> belonging to the same context. The <code class="directive"><a href="#rewriteoptions">RewriteOptions</a></code> directive can change this behavior,
+for example using the <em>Inherit</em> setting.</li>
+
+<li>The <code class="directive"><a href="#rewriteoptions">RewriteOptions</a></code> also regulates the
+behavior of sections that are stated at the same nesting level of the configuration. In the
+following example, by default only the RewriteRules stated in the second
+<code class="directive"><a href="../mod/core.html#if">If</a></code> block
+are considered, since the first ones are overridden. Using <code class="directive"><a href="#rewriteoptions">RewriteOptions</a></code> Inherit forces mod_rewrite to merge the two
+sections and consider both set of statements, rather than only the last one.</li>
</ul>
+<div class="example"><pre class="prettyprint lang-config">&lt;If "true"&gt;
+ # Without RewriteOptions Inherit, this rule is overridden by the next
+ # section and no redirect will happen for URIs containing 'foo'
+ RewriteRule foo http://example.com/foo [R]
+&lt;/If&gt;
+&lt;If "true"&gt;
+ RewriteRule bar http://example.com/bar [R]
+&lt;/If&gt;</pre>
+</div>
</div>
<p>For some hints on <a class="glossarylink" href="../glossary.html#regex" title="see glossary">regular
@@ -1184,13 +1226,16 @@ cannot use <code>$N</code> in the substitution string!
<dt>Absolute URL</dt>
- <dd>If an absolute URL is specified,
+ <dd><p>If an absolute URL is specified,
<code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code> checks to see whether the
hostname matches the current host. If it does, the scheme and
hostname are stripped out and the resulting path is treated as
a URL-path. Otherwise, an external redirect is performed for
the given URL. To force an external redirect back to the
- current host, see the <code>[R]</code> flag below.</dd>
+ current host, see the <code>[R]</code> flag below.</p>
+ <p>Note that a redirect (implicit or not) using an absolute URI
+ will include the requested query-string, to prevent this see the
+ <code>[QSD]</code> flag below.</p></dd>
<dt><code>-</code> (dash)</dt>
@@ -1264,9 +1309,20 @@ cannot use <code>$N</code> in the substitution string!
<tr>
<td>B</td>
<td>Escape non-alphanumeric characters in backreferences <em>before</em>
- applying the transformation. <em><a href="../rewrite/flags.html#flag_b">details ...</a></em></td>
+ applying the transformation. For similar escaping of server-variables, see
+ the "escape" <a href="#mapfunc">mapping-function</a>.<em><a href="../rewrite/flags.html#flag_b">details ...</a></em></td>
</tr>
<tr class="odd">
+ <td>BCTLS</td>
+ <td>Like [B], but only escape control characters and spaces.
+ <em><a href="../rewrite/flags.html#flag_bctls">details ...</a></em></td>
+ </tr>
+<tr>
+ <td>BNE</td>
+ <td>Characters of [B] or [BCTLS] which should <strong>not</strong> be escaped.
+ <em><a href="../rewrite/flags.html#flag_bne">details ...</a></em></td>
+ </tr>
+<tr class="odd">
<td>backrefnoplus|BNP</td>
<td>If backreferences are being escaped, spaces should be escaped to
%20 instead of +. Useful when the backreference will be used in the
@@ -1280,7 +1336,7 @@ cannot use <code>$N</code> in the substitution string!
<tr class="odd">
<td>cookie|CO=<em>NAME</em>:<em>VAL</em></td>
<td>Sets a cookie in the client browser. Full syntax is:
- CO=<em>NAME</em>:<em>VAL</em>:<em>domain</em>[:<em>lifetime</em>[:<em>path</em>[:<em>secure</em>[:<em>httponly</em>]]]] <em><a href="../rewrite/flags.html#flag_co">details ...</a></em>
+ CO=<em>NAME</em>:<em>VAL</em>:<em>domain</em>[:<em>lifetime</em>[:<em>path</em>[:<em>secure</em>[:<em>httponly</em>[<em>samesite</em>]]]]] <em><a href="../rewrite/flags.html#flag_co">details ...</a></em>
</td>
</tr>
<tr>
@@ -1338,7 +1394,9 @@ cannot use <code>$N</code> in the substitution string!
<tr class="odd">
<td>noescape|NE</td>
<td>Prevent mod_rewrite from applying hexcode escaping of
- special characters in the result of the rewrite. <em><a href="../rewrite/flags.html#flag_ne">details ...</a></em></td>
+ special characters in the result of rewrites that result in
+ redirection. <em>
+ <a href="../rewrite/flags.html#flag_ne">details ...</a></em></td>
</tr>
<tr>
<td>nosubreq|NS</td>
@@ -1538,8 +1596,8 @@ redirection</td>
</div>
<div class="bottomlang">
<p><span>Available Languages: </span><a href="../en/mod/mod_rewrite.html" title="English">&nbsp;en&nbsp;</a> |
-<a href="../fr/mod/mod_rewrite.html" hreflang="fr" rel="alternate" title="Français">&nbsp;fr&nbsp;</a></p>
-</div><div class="top"><a href="#page-header"><img src="../images/up.gif" alt="top" /></a></div><div class="section"><h2><a id="comments_section" name="comments_section">Comments</a></h2><div class="warning"><strong>Notice:</strong><br />This is not a Q&amp;A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed again by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Freenode, or sent to our <a href="http://httpd.apache.org/lists.html">mailing lists</a>.</div>
+<a href="../fr/mod/mod_rewrite.html" hreflang="fr" rel="alternate" title="Français">&nbsp;fr&nbsp;</a></p>
+</div><div class="top"><a href="#page-header"><img src="../images/up.gif" alt="top" /></a></div><div class="section"><h2><a id="comments_section" name="comments_section">Comments</a></h2><div class="warning"><strong>Notice:</strong><br />This is not a Q&amp;A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Libera.chat, or sent to our <a href="https://httpd.apache.org/lists.html">mailing lists</a>.</div>
<script type="text/javascript"><!--//--><![CDATA[//><!--
var comments_shortname = 'httpd';
var comments_identifier = 'http://httpd.apache.org/docs/2.4/mod/mod_rewrite.html';
@@ -1557,7 +1615,7 @@ var comments_identifier = 'http://httpd.apache.org/docs/2.4/mod/mod_rewrite.html
}
})(window, document);
//--><!]]></script></div><div id="footer">
-<p class="apache">Copyright 2019 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>
+<p class="apache">Copyright 2024 The Apache Software Foundation.<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="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!--
if (typeof(prettyPrint) !== 'undefined') {
prettyPrint();
diff --git a/docs/manual/mod/mod_rewrite.html.fr.utf8 b/docs/manual/mod/mod_rewrite.html.fr.utf8
index 24262ad..8a5eaf0 100644
--- a/docs/manual/mod/mod_rewrite.html.fr.utf8
+++ b/docs/manual/mod/mod_rewrite.html.fr.utf8
@@ -385,7 +385,11 @@ la réécriture soit effectuée
<dd>La partie chemin de l'URI de la requête, comme
"/index.html". Ceci exclut en particulier la chaîne de
paramètres de la requête qui est contenue dans la
- variable <code>QUERY_STRING</code>.</dd>
+ variable <code>QUERY_STRING</code>. La valeur renvoyée pour
+ <code>REQUEST_URI</code> a déjà été %-décodée ; pour la
+ recoder, passez-la à la <a href="#mapfunc">fonction de
+ mappage</a> "escape".
+ </dd>
<dt><code>THE_REQUEST</code></dt>
@@ -572,6 +576,15 @@ la réécriture soit effectuée
égale à <em>expression_de_comparaison</em> (les deux chaînes
sont identiques, caractère pour caractère).</dd>
</dl>
+ <div class="note"><h3>Note</h3>
+ L'opérateur de comparaison de chaînes fait partie des arguments de la
+ <em>CondPattern</em> et doit par conséquent se trouver entre les
+ guillemets s'ils sont présents. Exemple :
+
+ <pre class="prettyprint lang-config">RewriteCond %{HTTP_USER_AGENT} "=This Robot/1.0"</pre>
+
+ </div>
+
</li>
<li>
@@ -797,6 +810,14 @@ RewriteRule "^/$" "/homepage.std.html" [L]</pre>
sera renvoyée. Dans le cas contraire, ce sera la page d'accueil
standard.</p>
+ <p>Par défaut, plusieurs directives <code class="directive">RewriteCond</code>
+ sont évaluées de manière séquentielle et combinées à l'aide d'un
+ <strong>ET</strong> logique. Si une condition n'est pas vérifiée et en
+ l'absence d'un opérateur logique <strong><code>OU</code></strong>,
+ l'ensemble du jeu de règles est abandonné et les conditions restantes ne
+ sont pas évaluées.
+ </p>
+
</div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
@@ -1211,7 +1232,33 @@ d'expression rationnelle), elles n'y sont pas prises en compte, et
n'y sont à priori d'aucune utilité. Les substitutions
relatives sont une fonctionnalité qui n'est, elle non-plus pas supportée
dans ce genre de contexte.</li>
+
+<li>Les blocs <code class="directive"><a href="../mod/core.html#if">If</a></code> suivent les règles
+du contexte de <em>répertoire</em>.</li>
+
+<li>Par défaut, mod_rewrite écrase les règles précédentes au sein de <a href="../sections.html#merging">sections combinées</a> appartenant au même
+contexte. Pour modifier ce comportement, on peut utiliser la directive
+<code class="directive"><a href="#rewriteoptions">RewriteOptions</a></code> pour définir par
+exemple l'option <em>Inherit</em>.</li>
+
+<li>La directive <code class="directive"><a href="#rewriteoptions">RewriteOptions</a></code>
+permet aussi de contrôler le comportement des sections définies au même niveau
+d'imbrication dans la configuration. Dans l'exemple suivant, par défaut seule la
+règle RewriteRules définie dans le second bloc <code class="directive"><a href="../mod/core.html#if">If</a></code> est prise en compte car celle définie dans le
+premier bloc est écrasée. Définir <code class="directive"><a href="#rewriteoptions">RewriteOptions</a></code> Inherit force mod_rewrite à
+combiner les deux sections en prenant en compte les deux règles et pas seulement
+la dernière.</li>
</ul>
+<div class="example"><pre class="prettyprint lang-config">&lt;If "true"&gt;
+ # Sans RewriteOptions Inherit, cette règle est écrasée par celle de la section
+ # suivante et aucune redirection ne sera effectuée pour les URIs contenant
+ # 'foo'
+ RewriteRule foo http://example.com/foo [R]
+&lt;/If&gt;
+&lt;If "true"&gt;
+ RewriteRule bar http://example.com/bar [R]
+&lt;/If&gt;</pre>
+</div>
</div>
<p>Pour quelques conseils à propos des <a class="glossarylink" href="../glossary.html#regex" title="voir glossaire">expressions rationnelles</a>, voir le
@@ -1277,14 +1324,17 @@ substitution !
<dt>URL absolue</dt>
- <dd>Si une URL absolue est spécifiée,
+ <dd><p>Si une URL absolue est spécifiée,
<code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code> vérifie si le nom d'hôte
correspond à celui de l'hôte local. Si c'est le cas, le
protocole et le nom d'hôte sont supprimés, et ce qui reste est
traité comme un chemin d'URL. Dans le cas contraire, une
redirection externe vers l'URL indiquée est effectuée. Pour
forcer une redirection externe vers l'hôte local, voir le
- drapeau <code>[R]</code> ci-dessous.</dd>
+ drapeau <code>[R]</code> ci-dessous.</p>
+ <p>Notez qu'une redirection (implicite ou non) qui utilise une URI
+ absolue inclura la chaîne de paramètres de la requête ; pour éviter
+ ceci, voir le drapeau <code>[QSD]</code> ci-dessous.</p></dd>
<dt><code>-</code> (tiret)</dt>
@@ -1365,9 +1415,20 @@ substitution !
</tr>
<tr>
<td>B</td>
- <td>Echappe les caractères non-alphanumériques
- dans les références arrières <em>avant</em>
- d'appliquer la transformation. <em><a href="../rewrite/flags.html#flag_b">détails ...</a></em></td>
+ <td>Echappe les caractères non-alphanumériques dans les références
+ arrières <em>avant</em> d'appliquer la transformation. Pour un
+ échappement similaire des variables du serveur, voir la <a href="#mapfunc">fonction de mappage</a> "escape".<em><a href="../rewrite/flags.html#flag_b">détails ...</a></em></td>
+ </tr>
+<tr class="odd">
+ <td>BCTLS</td>
+ <td>Identique à [B], mais n'échappe que les espaces et les caractères de
+ contrôle. <em><a href="../rewrite/flags.html#flag_bctls">détails ...</a></em></td>
+ </tr>
+<tr>
+ <td>BNE</td>
+ <td>Les caractères de [B] ou [BCTLS] qui <strong>ne doivent pas</strong>
+ être échappés. <em><a href="../rewrite/flags.html#flag_bne">détails
+ ...</a></em></td>
</tr>
<tr class="odd">
<td>backrefnoplus|BNP</td>
@@ -1387,7 +1448,7 @@ substitution !
<td>cookie|CO=<em>NAME</em>:<em>VAL</em></td>
<td>Définit un cookie au niveau du navigateur client. La syntaxe
complète est :
- CO=<em>NAME</em>:<em>VAL</em>:<em>domain</em>[:<em>lifetime</em>[:<em>path</em>[:<em>secure</em>[:<em>httponly</em>]]]] <em><a href="../rewrite/flags.html#flag_co">details ...</a></em>
+ CO=<em>NAME</em>:<em>VAL</em>:<em>domain</em>[:<em>lifetime</em>[:<em>path</em>[:<em>secure</em>[:<em>httponly</em>[<em>samesite</em>]]]]] <em><a href="../rewrite/flags.html#flag_co">details ...</a></em>
<em><a href="../rewrite/flags.html#flag_co">détails ...</a></em>
</td>
</tr>
@@ -1446,7 +1507,8 @@ substitution !
<tr class="odd">
<td>noescape|NE</td>
<td>Empêche mod_rewrite d'effectuer un échappement hexadécimal
- des caractères spéciaux dans le résultat de la réécriture. <em><a href="../rewrite/flags.html#flag_ne">détails ...</a></em></td>
+ des caractères spéciaux dans le résultat des réécritures qui aboutissent
+ à une redirection. <em><a href="../rewrite/flags.html#flag_ne">détails ...</a></em></td>
</tr>
<tr>
<td>nosubreq|NS</td>
@@ -1646,7 +1708,7 @@ externe</td>
<div class="bottomlang">
<p><span>Langues Disponibles: </span><a href="../en/mod/mod_rewrite.html" hreflang="en" rel="alternate" title="English">&nbsp;en&nbsp;</a> |
<a href="../fr/mod/mod_rewrite.html" title="Français">&nbsp;fr&nbsp;</a></p>
-</div><div class="top"><a href="#page-header"><img src="../images/up.gif" alt="top" /></a></div><div class="section"><h2><a id="comments_section" name="comments_section">Commentaires</a></h2><div class="warning"><strong>Notice:</strong><br />This is not a Q&amp;A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed again by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Freenode, or sent to our <a href="http://httpd.apache.org/lists.html">mailing lists</a>.</div>
+</div><div class="top"><a href="#page-header"><img src="../images/up.gif" alt="top" /></a></div><div class="section"><h2><a id="comments_section" name="comments_section">Commentaires</a></h2><div class="warning"><strong>Notice:</strong><br />This is not a Q&amp;A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Libera.chat, or sent to our <a href="https://httpd.apache.org/lists.html">mailing lists</a>.</div>
<script type="text/javascript"><!--//--><![CDATA[//><!--
var comments_shortname = 'httpd';
var comments_identifier = 'http://httpd.apache.org/docs/2.4/mod/mod_rewrite.html';
@@ -1664,7 +1726,7 @@ var comments_identifier = 'http://httpd.apache.org/docs/2.4/mod/mod_rewrite.html
}
})(window, document);
//--><!]]></script></div><div id="footer">
-<p class="apache">Copyright 2019 The Apache Software Foundation.<br />Autorisé sous <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>
+<p class="apache">Copyright 2024 The Apache Software Foundation.<br />Autorisé sous <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="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">Glossaire</a> | <a href="../sitemap.html">Plan du site</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!--
if (typeof(prettyPrint) !== 'undefined') {
prettyPrint();