<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 using mod_rewrite.</p>
+a few advanced techniques using <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code>.</p>
<dd>
<p>We wish to randomly distribute load across several servers
- using mod_rewrite.</p>
+ using <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code>.</p>
</dd>
<dt>Solution:</dt>
<dd>
<p>Apache comes with a load-balancing module -
<code class="module"><a href="../mod/mod_proxy_balancer.html">mod_proxy_balancer</a></code> - which is far more flexible and
-featureful than anything you can cobble together using mod_rewrite.</p>
+featureful than anything you can cobble together using <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code>.</p>
</dd>
</dl>
<dd>
<p>By default, redirecting to an HTML anchor doesn't work,
- because mod_rewrite escapes the <code>#</code> character,
+ because <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code> escapes the <code>#</code> character,
turning it into <code>%23</code>. This, in turn, breaks the
redirection.</p>
</dd>
<dt>Discussion:</dt>
<dd>This technique will of course also work with other
- special characters that mod_rewrite, by default, URL-encodes.</dd>
+ special characters that <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code>, by default, URL-encodes.</dd>
</dl>
</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<dt>Description:</dt>
<dd>
- <p>We wish to use mod_rewrite to serve different content based on
+ <p>We wish to use <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code> to serve different content based on
the time of day.</p>
</dd>
<p><span>Langues Disponibles: </span><a href="../en/rewrite/advanced.html" hreflang="en" rel="alternate" title="English"> en </a> |
<a href="../fr/rewrite/advanced.html" title="Français"> fr </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 complète la <a href="../mod/mod_rewrite.html">documentation de référence</a> du
<?xml-stylesheet type="text/xsl" href="../style/manual.fr.xsl"?>
<!-- French translation : Lucien GENTIS -->
<!-- Reviewed by : Vincent Deffontaines -->
-<!-- English Revision: 1897425 -->
+<!-- English Revision: 1897425:1933067 (outdated) -->
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
<variants>
<variant>en</variant>
- <variant>fr</variant>
+ <variant outdated="yes">fr</variant>
</variants>
</metafile>
<div class="section">
<h2><a name="vhosts" id="vhosts">Virtual Hosting</a> <a title="Permanent link" href="#vhosts" class="permalink">¶</a></h2>
<p>Although it is possible to handle <a href="vhosts.html">virtual hosts
-with <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code></a>, it is seldom the right way. Creating individual
+with mod_rewrite</a>, it is seldom the right way. Creating individual
<code class="directive"><a href="../mod/core.html#virtualhost"><VirtualHost></a></code> blocks is
almost always the right way to go. In the
event that you have an enormous number of virtual hosts, consider using
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
<?xml-stylesheet type="text/xsl" href="../style/manual.fr.xsl"?>
-<!-- English Revision: 1872293:1933060 (outdated) -->
+<!-- English Revision: 1872293:1933071 (outdated) -->
<!-- French translation : Lucien GENTIS -->
<!-- Reviewed by : Vincent Deffontaines -->
<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 describes
-the way that the rules change when you use mod_rewrite in .htaccess files,
+the way that the rules change when you use <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code> in .htaccess files,
and how to deal with these changes.</p>
</div>
<p><span>Langues Disponibles: </span><a href="../en/rewrite/htaccess.html" hreflang="en" rel="alternate" title="English"> en </a> |
<a href="../fr/rewrite/htaccess.html" title="Français"> fr </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 de la <a href="../mod/mod_rewrite.html">documentation de référence</a> du module
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
<?xml-stylesheet type="text/xsl" href="../style/manual.fr.xsl"?>
-<!-- English Revision : 1174747 -->
+<!-- English Revision: 1174747:1933067 (outdated) -->
<!-- French translation : Lucien GENTIS -->
<!-- Reviewed by : Vincent Deffontaines -->
<variants>
<variant>en</variant>
- <variant>fr</variant>
+ <variant outdated="yes">fr</variant>
</variants>
</metafile>
<dd>
<p>
- mod_rewrite provides the [P] flag, which allows URLs to be passed,
- via mod_proxy, to another server. Two examples are given here. In
+ <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code> provides the [P] flag, which allows URLs to be passed,
+ via <code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code>, to another server. Two examples are given here. In
one example, a URL is passed directly to another server, and served
as though it were a local URL. In the other example, we proxy
missing content to a back-end server.</p>
the client.</p>
<p>Consider using either <code class="directive"><a href="../mod/mod_proxy.html#proxypass">ProxyPass</a></code> or <code class="directive"><a href="../mod/mod_proxy.html#proxypassmatch">ProxyPassMatch</a></code> whenever possible in
- preference to mod_rewrite.</p>
+ preference to <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code>.</p>
</dd>
</dl>
<p><span>Langues Disponibles: </span><a href="../en/rewrite/proxy.html" hreflang="en" rel="alternate" title="English"> en </a> |
<a href="../fr/rewrite/proxy.html" title="Français"> fr </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 de la <a href="../mod/mod_rewrite.html">documentation de référence</a> du module
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
<?xml-stylesheet type="text/xsl" href="../style/manual.fr.xsl"?>
-<!-- English Revision: 1673945 -->
+<!-- English Revision: 1673945:1933067 (outdated) -->
<!-- French translation : Lucien GENTIS -->
<!-- Reviewed by : Vincent Deffontaines -->
<variants>
<variant>en</variant>
- <variant>fr</variant>
+ <variant outdated="yes">fr</variant>
</variants>
</metafile>
<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 describes
how you can use <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code> to redirect and remap
-request. This includes many examples of common uses of mod_rewrite,
+request. This includes many examples of common uses of <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code>,
including detailed descriptions of how each works.</p>
<div class="warning">Note that many of these examples won't work unchanged in your
<dd>
<p>In this example, as contrasted to the <a href="#old-to-new-intern">internal</a> example above, we can simply
- use the Redirect directive. mod_rewrite was used in that earlier
+ use the Redirect directive. <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code> was used in that earlier
example in order to hide the redirect from the client:</p>
<pre class="prettyprint lang-config">Redirect "/foo.html" "/bar.html"</pre>
<dt>Discussion</dt>
<dd>
- <p>This example uses an often-overlooked feature of mod_rewrite,
+ <p>This example uses an often-overlooked feature of <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code>,
by taking advantage of the order of execution of the ruleset. In
- particular, mod_rewrite evaluates the left-hand-side of the
+ particular, <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code> evaluates the left-hand-side of the
RewriteRule before it evaluates the RewriteCond directives.
Consequently, $1 is already defined by the time the RewriteCond
directives are evaluated. This allows us to test for the existence
<dd>
-<p>The very best way to solve this doesn't involve mod_rewrite at all,
+<p>The very best way to solve this doesn't involve <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code> at all,
but rather uses the <code class="directive"><a href="../mod/mod_alias.html#redirect">Redirect</a></code>
directive placed in a virtual host for the non-canonical
hostname(s).</p>
</If></pre>
-<p>If, for whatever reason, you still want to use <code>mod_rewrite</code>
+<p>If, for whatever reason, you still want to use <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code>
- if, for example, you need this to work with a larger set of RewriteRules -
you might use one of the recipes below.</p>
<p><span>Langues Disponibles: </span><a href="../en/rewrite/remapping.html" hreflang="en" rel="alternate" title="English"> en </a> |
<a href="../fr/rewrite/remapping.html" title="Français"> fr </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> de
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
<?xml-stylesheet type="text/xsl" href="../style/manual.fr.xsl"?>
-<!-- English Revision: 1932321 -->
+<!-- English Revision: 1932321:1933068 (outdated) -->
<!-- French translation : Lucien GENTIS -->
<!-- Reviewed by : Vincent Deffontaines -->
<variants>
<variant>en</variant>
- <variant>fr</variant>
+ <variant outdated="yes">fr</variant>
</variants>
</metafile>
<a href="../fr/rewrite/tech.html" hreflang="fr" rel="alternate" title="Français"> fr </a></p>
</div>
-<p>This document discusses some of the technical details of mod_rewrite
+<p>This document discusses some of the technical details of <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code>
and URL matching.</p>
</div>
<div id="quickview"><ul id="toc"><li><img alt="" src="../images/down.gif" /> <a href="#InternalAPI">API Phases</a></li>
like URL-to-filename translation, authentication, authorization,
content, and logging. (This is not an exhaustive list.)</p>
- <p>mod_rewrite acts in two of these phases (or "hooks", as they are
+ <p><code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code> acts in two of these phases (or "hooks", as they are
often called) to influence how URLs may be rewritten.</p>
<p>First, it uses the URL-to-filename translation hook, which occurs
<p>After a request comes in and a corresponding server or
virtual host has been determined, the rewriting engine starts
- processing any <code>mod_rewrite</code> directives appearing in the
+ processing any <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code> directives appearing in the
per-server configuration. (i.e., in the main server configuration file
and <code class="directive"><a href="../mod/core.html#virtualhost"><Virtualhost></a></code>
sections.) This happens in the URL-to-filename phase.</p>
files and <code class="directive"><a href="../mod/core.html#directory"><Directory></a></code> blocks) are applied. This
happens in the Fixup phase.</p>
- <p>In each of these cases, mod_rewrite rewrites the
+ <p>In each of these cases, <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code> rewrites the
<code>REQUEST_URI</code> either to a new URL, or to a filename.</p>
<p>In per-directory context (i.e., within <code>.htaccess</code> files
and <code>Directory</code> blocks), these rules are being applied
after a URL has already been translated to a filename. Because of
- this, the URL-path that mod_rewrite initially compares <code class="directive"><a href="../mod/mod_rewrite.html#rewriterule">RewriteRule</a></code> directives against
+ this, the URL-path that <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code> initially compares <code class="directive"><a href="../mod/mod_rewrite.html#rewriterule">RewriteRule</a></code> directives against
is the full filesystem path to the translated filename with the current
directories path (including a trailing slash) removed from the front.</p>
</table>
- <p>For even more insight into how mod_rewrite manipulates URLs in
+ <p>For even more insight into how <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code> manipulates URLs in
different contexts, you should consult the <a href="../mod/mod_rewrite.html#logging">log entries</a> made during
rewriting.</p>
<div class="section">
<h2><a name="InternalRuleset" id="InternalRuleset">Ruleset Processing</a> <a title="Permanent link" href="#InternalRuleset" class="permalink">¶</a></h2>
- <p>Now when mod_rewrite is triggered in these two API phases, it
+ <p>Now when <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code> is triggered in these two API phases, it
reads the configured rulesets from its configuration
structure (which itself was either created on startup for
per-server context or during the directory walk of the Apache
<dfn>Figure 1:</dfn>The control flow through the rewriting ruleset
</p>
<p>First the URL is matched against the
- <em>Pattern</em> of each rule. If it fails, mod_rewrite
+ <em>Pattern</em> of each rule. If it fails, <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code>
immediately stops processing this rule, and continues with the
- next rule. If the <em>Pattern</em> matches, mod_rewrite looks
+ next rule. If the <em>Pattern</em> matches, <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code> looks
for corresponding rule conditions (RewriteCond directives,
appearing immediately above the RewriteRule in the configuration).
If none are present, it substitutes the URL with a new value, which is
<p><span>Langues Disponibles: </span><a href="../en/rewrite/tech.html" hreflang="en" rel="alternate" title="English"> en </a> |
<a href="../fr/rewrite/tech.html" title="Français"> fr </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 passe en revue certains détails techniques à propos du
module mod_rewrite et de la mise en correspondance des URLs</p>
<?xml version="1.0" ?>
<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
<?xml-stylesheet type="text/xsl" href="../style/manual.fr.xsl"?>
-<!-- English Revision: 1673945 -->
+<!-- English Revision: 1673945:1933069 (outdated) -->
<!-- French translation : Lucien GENTIS -->
<!-- Reviewed by : Vincent Deffontaines -->
<variants>
<variant>en</variant>
- <variant>fr</variant>
+ <variant outdated="yes">fr</variant>
</variants>
</metafile>
how you can use <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code> to create dynamically
configured virtual hosts.</p>
-<div class="warning">mod_rewrite is usually not the best way to configure
+<div class="warning"><code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code> is usually not the best way to configure
virtual hosts. You should first consider the <a href="../vhosts/mass.html">alternatives</a> before resorting to
mod_rewrite. See also the "<a href="avoid.html#vhosts">how to avoid
mod_rewrite</a> document.</div>
skipped.</p>
<p>
-As with many techniques discussed in this document, mod_rewrite really
+As with many techniques discussed in this document, <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code> really
isn't the best way to accomplish this task. You should, instead,
consider using <code class="module"><a href="../mod/mod_vhost_alias.html">mod_vhost_alias</a></code> instead, as it will much
more gracefully handle anything beyond serving static files, such as any
thing as <a href="#per-hostname">the first example</a>. The first
half is very similar to the corresponding part above, except for
some changes, required for backward compatibility and to make the
- <code>mod_rewrite</code> part work properly; the second half
- configures <code>mod_rewrite</code> to do the actual work.</p>
+ <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code> part work properly; the second half
+ configures <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code> to do the actual work.</p>
- <p>Because <code>mod_rewrite</code> runs before other URI translation
- modules (e.g., <code>mod_alias</code>), <code>mod_rewrite</code> must
+ <p>Because <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code> runs before other URI translation
+ modules (e.g., <code class="module"><a href="../mod/mod_alias.html">mod_alias</a></code>), <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code> must
be told to explicitly ignore any URLs that would have been handled
by those modules. And, because these rules would otherwise bypass
any <code>ScriptAlias</code> directives, we must have
- <code>mod_rewrite</code> explicitly enact those mappings.</p>
+ <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code> explicitly enact those mappings.</p>
<pre class="prettyprint lang-config"># get the server name from the Host: header
UseCanonicalName Off
<p><span>Langues Disponibles: </span><a href="../en/rewrite/vhosts.html" hreflang="en" rel="alternate" title="English"> en </a> |
<a href="../fr/rewrite/vhosts.html" title="Français"> fr </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
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
<?xml-stylesheet type="text/xsl" href="../style/manual.fr.xsl"?>
-<!-- English Revision: 1874148 -->
+<!-- English Revision: 1874148:1933071 (outdated) -->
<!-- French translation : Lucien GENTIS -->
<!-- Reviewed by : Vincent Deffontaines -->
<variants>
<variant>en</variant>
- <variant>fr</variant>
+ <variant outdated="yes">fr</variant>
</variants>
</metafile>