mod_rewrite.html.en revision cc7e1025de9ac63bd4db6fe7f71c158b2cf09fe4
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><!--
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess This file is generated from xml source: DO NOT EDIT
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
5a58787efeb02a1c3f06569d019ad81fd2efa06end<link href="/style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
5a58787efeb02a1c3f06569d019ad81fd2efa06end<link href="/style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen<link href="/style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="/style/css/prettify.css" />
2e545ce2450a9953665f701bb05350f0d3f26275nd<script src="/style/scripts/prettify.js" type="text/javascript">
5a58787efeb02a1c3f06569d019ad81fd2efa06end<link href="/images/favicon.ico" rel="shortcut icon" /></head>
3f08db06526d6901aa08c110b5bc7dde6bc39905nd<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>
5a58787efeb02a1c3f06569d019ad81fd2efa06end<div class="up"><a href="./"><img title="<-" alt="<-" src="/images/left.gif" /></a></div>
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd<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.5</a> > <a href="./">Modules</a></div>
ecc5150d35c0dc5ee5119c2717e6660fa331abbftakashi<p><span>Available Languages: </span><a href="/en/mod/mod_rewrite.html" title="English"> en </a> |
f086b4b402fa9a2fefc7dda85de2a3cc1cd0a654rjung<a href="/fr/mod/mod_rewrite.html" hreflang="fr" rel="alternate" title="Fran�ais"> fr </a></p>
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd<table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>Provides a rule-based rewriting engine to rewrite requested
6e14faf37935e36804b8bad802bc9dd58f3cf65dsf<tr><th><a href="module-dict.html#Status">Status:</a></th><td>Extension</td></tr>
5a58787efeb02a1c3f06569d019ad81fd2efa06end<tr><th><a href="module-dict.html#ModuleIdentifier">Module�Identifier:</a></th><td>rewrite_module</td></tr>
5a58787efeb02a1c3f06569d019ad81fd2efa06end<tr><th><a href="module-dict.html#SourceFile">Source�File:</a></th><td>mod_rewrite.c</td></tr></table>
5a58787efeb02a1c3f06569d019ad81fd2efa06end <p>The <code class="module"><a href="/mod/mod_rewrite.html">mod_rewrite</a></code> module uses a rule-based rewriting
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess engine, based on a PCRE regular-expression parser, to rewrite requested URLs on
30471a4650391f57975f60bbb6e4a90be7b284bfhumbedooh the fly. By default, <code class="module"><a href="/mod/mod_rewrite.html">mod_rewrite</a></code> maps a URL to a filesystem
5a58787efeb02a1c3f06569d019ad81fd2efa06end path. However, it can also be used to redirect one URL to another URL, or
5a58787efeb02a1c3f06569d019ad81fd2efa06end to invoke an internal proxy fetch.</p>
6e14faf37935e36804b8bad802bc9dd58f3cf65dsf <p><code class="module"><a href="/mod/mod_rewrite.html">mod_rewrite</a></code> provides a flexible and powerful way to
6e14faf37935e36804b8bad802bc9dd58f3cf65dsf manipulate URLs using an unlimited number of rules. Each rule can have an
6e14faf37935e36804b8bad802bc9dd58f3cf65dsf unlimited number of attached rule conditions, to allow you to rewrite URL
6e14faf37935e36804b8bad802bc9dd58f3cf65dsf based on server variables, environment variables, HTTP headers, or time
6e14faf37935e36804b8bad802bc9dd58f3cf65dsf stamps.</p>
6e14faf37935e36804b8bad802bc9dd58f3cf65dsf <p><code class="module"><a href="/mod/mod_rewrite.html">mod_rewrite</a></code> operates on the full URL path, including the
6e14faf37935e36804b8bad802bc9dd58f3cf65dsf path-info section. A rewrite rule can be invoked in
6e14faf37935e36804b8bad802bc9dd58f3cf65dsf <code>httpd.conf</code> or in <code>.htaccess</code>. The path generated
6e14faf37935e36804b8bad802bc9dd58f3cf65dsf by a rewrite rule can include a query string, or can lead to internal
6e14faf37935e36804b8bad802bc9dd58f3cf65dsf sub-processing, external request redirection, or internal proxy
6e14faf37935e36804b8bad802bc9dd58f3cf65dsf throughput.</p>
5a58787efeb02a1c3f06569d019ad81fd2efa06end <p>Further details, discussion, and examples, are provided in the
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess <a href="/rewrite/">detailed mod_rewrite documentation</a>.</p>
60a4b2c422dcbb08a554fb193105c08da592718bpoirier<div id="quickview"><h3 class="directives">Directives</h3>
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess<li><img alt="" src="/images/down.gif" /> <a href="#rewritebase">RewriteBase</a></li>
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess<li><img alt="" src="/images/down.gif" /> <a href="#rewritecond">RewriteCond</a></li>
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess<li><img alt="" src="/images/down.gif" /> <a href="#rewriteengine">RewriteEngine</a></li>
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess<li><img alt="" src="/images/down.gif" /> <a href="#rewritemap">RewriteMap</a></li>
60a4b2c422dcbb08a554fb193105c08da592718bpoirier<li><img alt="" src="/images/down.gif" /> <a href="#rewriteoptions">RewriteOptions</a></li>
60a4b2c422dcbb08a554fb193105c08da592718bpoirier<li><img alt="" src="/images/down.gif" /> <a href="#rewriterule">RewriteRule</a></li>
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess<li><img alt="" src="/images/down.gif" /> <a href="#logging">Logging</a></li>
5a58787efeb02a1c3f06569d019ad81fd2efa06end</ul><ul class="seealso"><li><a href="#comments_section">Comments</a></li></ul></div>
5a58787efeb02a1c3f06569d019ad81fd2efa06end<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
9bcfc3697a91b5215893a7d0206865b13fc72148nd <p><code class="module"><a href="/mod/mod_rewrite.html">mod_rewrite</a></code> offers detailed logging of its actions
9bcfc3697a91b5215893a7d0206865b13fc72148nd at the <code>trace1</code> to <code>trace8</code> log levels. The
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess log level can be set specifically for <code class="module"><a href="/mod/mod_rewrite.html">mod_rewrite</a></code>
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess using the <code class="directive"><a href="/mod/core.html#loglevel">LogLevel</a></code> directive: Up to
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess level <code>debug</code>, no actions are logged, while <code>trace8</code>
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess means that practically all actions are logged.</p>
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess Using a high trace log level for <code class="module"><a href="/mod/mod_rewrite.html">mod_rewrite</a></code>
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess will slow down your Apache HTTP Server dramatically! Use a log
df47c169dad27600c1e98e547a065378c5e9a2b3rbowen level higher than <code>trace2</code> only for debugging!
cd9f05dfac570b44f26f531e01869e679c45401berikabele <div class="example"><h3>Example</h3><pre class="prettyprint lang-config">
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess LogLevel alert rewrite:trace3
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess <p>Those familiar with earlier versions of
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess <code class="module"><a href="/mod/mod_rewrite.html">mod_rewrite</a></code> will no doubt be looking for the
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess <code>RewriteLog</code> and <code>RewriteLogLevel</code>
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess directives. This functionality has been completely replaced by the
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess new per-module logging configuration mentioned above.
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess <p>To get just the <code class="module"><a href="/mod/mod_rewrite.html">mod_rewrite</a></code>-specific log
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess messages, pipe the log file through grep:</p>
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess tail -f error_log|fgrep '[rewrite:'
5a58787efeb02a1c3f06569d019ad81fd2efa06end<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
5a58787efeb02a1c3f06569d019ad81fd2efa06end<div class="directive-section"><h2><a name="RewriteBase" id="RewriteBase">RewriteBase</a> <a name="rewritebase" id="rewritebase">Directive</a></h2>
9bcfc3697a91b5215893a7d0206865b13fc72148nd<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Sets the base URL for per-directory rewrites</td></tr>
9bcfc3697a91b5215893a7d0206865b13fc72148nd<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>RewriteBase <em>URL-path</em></code></td></tr>
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>None</code></td></tr>
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
20f499565e77defe9dab24dd85c02f38a1175855nd<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
c3c006c28c5b03892ccaef6e4d2cbb15a13a2072rbowen<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_rewrite</td></tr>
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess <p>The <code class="directive">RewriteBase</code> directive specifies the
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess URL prefix to be used for per-directory (htaccess)
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess <code class="directive">RewriteRule</code> directives that substitute a relative
5a58787efeb02a1c3f06569d019ad81fd2efa06end <p> This directive is <em>required</em> when you use a relative path
5a58787efeb02a1c3f06569d019ad81fd2efa06end in a substitution in per-directory (htaccess) context unless either
5ae30adbe59946de742ab0cd6be3b7457471a698takashi of the following conditions are true:</p>
9bcfc3697a91b5215893a7d0206865b13fc72148nd <li> The original request, and the substitution, are underneath the
9bcfc3697a91b5215893a7d0206865b13fc72148nd <code class="directive"><a href="/mod/core.html#documentroot">DocumentRoot</a></code>
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess (as opposed to reachable by other means, such as
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess <code class="directive"><a href="/mod/mod_alias.html#alias">Alias</a></code>).</li>
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess <li> The <em>filesystem</em> path to the directory containing the
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess <code class="directive">RewriteRule</code>, suffixed by the relative
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess substitution is also valid as a URL path on the server
4aa603e6448b99f9371397d439795c91a93637eand (this is rare).</li>
c3c006c28c5b03892ccaef6e4d2cbb15a13a2072rbowen<p> In the example below, <code class="directive">RewriteBase</code> is necessary
c3c006c28c5b03892ccaef6e4d2cbb15a13a2072rbowen to avoid rewriting to http://example.com/opt/myapp-1.2.3/welcome.html
c3c006c28c5b03892ccaef6e4d2cbb15a13a2072rbowen since the resource was not relative to the document root. This
c3c006c28c5b03892ccaef6e4d2cbb15a13a2072rbowen misconfiguration would normally cause the server to look for an "opt"
c3c006c28c5b03892ccaef6e4d2cbb15a13a2072rbowen directory under the document root.</p>
c3c006c28c5b03892ccaef6e4d2cbb15a13a2072rbowen RewriteEngine On
c3c006c28c5b03892ccaef6e4d2cbb15a13a2072rbowen RewriteBase /myapp/
4aa603e6448b99f9371397d439795c91a93637eand RewriteRule ^index\.html$ welcome.html
c3c006c28c5b03892ccaef6e4d2cbb15a13a2072rbowen</Directory>
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
6e14faf37935e36804b8bad802bc9dd58f3cf65dsf<div class="directive-section"><h2><a name="RewriteCond" id="RewriteCond">RewriteCond</a> <a name="rewritecond" id="rewritecond">Directive</a></h2>
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Defines a condition under which rewriting will take place
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code> RewriteCond
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess <em>TestString</em> <em>CondPattern</em></code></td></tr>
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_rewrite</td></tr>
1f6b6946407b900ccef68a0e9cd8baa0eba429e8rbowen <p>The <code class="directive">RewriteCond</code> directive defines a
1f6b6946407b900ccef68a0e9cd8baa0eba429e8rbowen rule condition. One or more <code class="directive">RewriteCond</code>
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess can precede a <code class="directive"><a href="#rewriterule">RewriteRule</a></code>
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess directive. The following rule is then only used if both
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess the current state of the URI matches its pattern, <strong>and</strong> if these conditions are met.</p>
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess <p><em>TestString</em> is a string which can contain the
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess following expanded constructs in addition to plain text:</p>
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd backreferences of the form <strong><code>$N</code></strong>
ad74a0524a06bfe11b7de9e3b4ce7233ab3bd3f7nd (0 <= N <= 9). $1 to $9 provide access to the grouped
d05d0eb4ae6d2a5e513fc3bf2555ce33da416634nd parts (in parentheses) of the pattern, from the
ecc5150d35c0dc5ee5119c2717e6660fa331abbftakashi set of <code>RewriteCond</code> conditions. $0 provides
f086b4b402fa9a2fefc7dda85de2a3cc1cd0a654rjung access to the whole string matched by that pattern.
727872d18412fc021f03969b8641810d8896820bhumbedooh <strong>RewriteCond backreferences</strong>: These are
cc7e1025de9ac63bd4db6fe7f71c158b2cf09fe4humbedooh backreferences of the form <strong><code>%N</code></strong>
0d0ba3a410038e179b695446bb149cce6264e0abnd (0 <= N <= 9). %1 to %9 provide access to the grouped
cc7e1025de9ac63bd4db6fe7f71c158b2cf09fe4humbedooh parts (again, in parentheses) of the pattern, from the last matched
0d0ba3a410038e179b695446bb149cce6264e0abnd of conditions. %0 provides access to the whole string matched by
0d0ba3a410038e179b695446bb149cce6264e0abnd that pattern.
0d0ba3a410038e179b695446bb149cce6264e0abnd expansions of the form <strong><code>${mapname:key|default}</code></strong>.
727872d18412fc021f03969b8641810d8896820bhumbedooh RewriteMap</a> for more details.
30471a4650391f57975f60bbb6e4a90be7b284bfhumbedooh <strong>Server-Variables</strong>: These are variables of
7fec19672a491661b2fe4b29f685bc7f4efa64d4nd from the following list:
<code class="directive"><a href="/mod/core.html#usecanonicalphysicalport">UseCanonicalPhysicalPort</a></code>
such as "/index.html". This notably excludes the
<code class="module"><a href="/mod/mod_ssl.html">mod_ssl</a></code> is loaded, but will always expand to
RewriteRule ...some special stuff for any of these hosts...
RewriteRule ^/$ /homepage.max.html [L]
RewriteRule ^/$ /homepage.min.html [L]
RewriteRule ^/$ /homepage.std.html [L]
<div class="directive-section"><h2><a name="RewriteEngine" id="RewriteEngine">RewriteEngine</a> <a name="rewriteengine" id="rewriteengine">Directive</a></h2>
<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enables or disables runtime rewriting engine</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>RewriteEngine on|off</code></td></tr>
<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>RewriteEngine off</code></td></tr>
<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
commenting out all the <code class="directive"><a href="#rewriterule">RewriteRule</a></code> directives!</p>
<div class="directive-section"><h2><a name="RewriteMap" id="RewriteMap">RewriteMap</a> <a name="rewritemap" id="rewritemap">Directive</a></h2>
<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Defines a mapping function for key-lookup</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>RewriteMap <em>MapName</em> <em>MapType</em>:<em>MapSource</em>
<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
<tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>The choice of different dbm types is available in
<dd>Randomly selects an entry from a plain text file (<a href="/rewrite/rewritemap.html#rnd">Details ...</a>)</dd>
<p>Further details, and numerous examples, may be found in the <a href="/rewrite/rewritemap.html">RewriteMap HowTo</a></p>
<div class="directive-section"><h2><a name="RewriteOptions" id="RewriteOptions">RewriteOptions</a> <a name="rewriteoptions" id="rewriteoptions">Directive</a></h2>
<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Sets some special options for the rewrite engine</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>RewriteOptions <var>Options</var></code></td></tr>
<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
<tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td><code>MaxRedirects</code> is no longer available in version 2.1 and
<p>By default, <code class="module"><a href="/mod/mod_rewrite.html">mod_rewrite</a></code> will ignore URLs that map to a
the <code class="module"><a href="/mod/mod_dir.html">mod_dir</a></code> module will issue the client with a redirect to
<p>When the <code class="directive"><a href="/mod/mod_dir.html#directoryslash">DirectorySlash</a></code> directive
<div class="directive-section"><h2><a name="RewriteRule" id="RewriteRule">RewriteRule</a> <a name="rewriterule" id="rewriterule">Directive</a></h2>
<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Defines rules for the rewriting engine</td></tr>
<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
<p>In <code class="directive"><a href="/mod/core.html#directory">Directory</a></code> and htaccess context,
<li>The rewrite engine may be used in <a href="/howto/htaccess.html">.htaccess</a> files and in <code class="directive"><a href="/mod/core.html#directory"><Directory></a></code> sections, with some additional
<li>Although rewrite rules are syntactically permitted in <code class="directive"><a href="/mod/core.html#location"><Location></a></code> and <code class="directive"><a href="/mod/core.html#files"><Files></a></code> sections, this
<p>For some hints on <a class="glossarylink" href="/glossary.html#regex" title="see glossary">regular
<dd>A <code class="directive"><a href="/mod/core.html#documentroot">DocumentRoot</a></code>-relative path to the
resource to be served. Note that <code class="module"><a href="/mod/mod_rewrite.html">mod_rewrite</a></code>
URL-mapping directives (such as <code class="directive"><a href="/mod/mod_alias.html#alias">Alias</a></code>) to be applied to the
<code class="module"><a href="/mod/mod_rewrite.html">mod_rewrite</a></code> checks to see whether the
in the config file. The URL-path or file-system path (see <a href="#what_is_matched">"What is matched?"</a>, above) is <strong>completely
<p>Additionally you can set special <a name="rewriteflags" id="rewriteflags">actions</a> to be performed by
details, and examples, for each flag, are available in the <a href="/rewrite/flags.html">Rewrite Flags document</a>.</p>
the rule(s) chained to it will be skipped. <em><a href="/rewrite/flags.html#flag_c">details ...</a></em></td>
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>
the environment variable <em>VAR</em> to be unset.<em><a href="/rewrite/flags.html#flag_e">details ...</a></em></td>
<td>Returns a 410 GONE response to the client browser. <em><a href="/rewrite/flags.html#flag_g">details ...</a></em></td>
<em>Content-handler</em> for processing. <em><a href="/rewrite/flags.html#flag_h">details ...</a></em></td>
.htaccess context (see also the END flag). <em><a href="/rewrite/flags.html#flag_l">details ...</a></em></td>
special characters in the result of the rewrite. <em><a href="/rewrite/flags.html#flag_ne">details ...</a></em></td>
any query string created in the rewrite target.<em><a href="/rewrite/flags.html#flag_qsa">details ...</a></em></td>
rules if the current rule matches. <em><a href="/rewrite/flags.html#flag_s">details ...</a></em></td>
<td>Force the <a class="glossarylink" href="/glossary.html#mime-type" title="see glossary">MIME-type</a> of the target file
<p><span>Available Languages: </span><a href="/en/mod/mod_rewrite.html" title="English"> en </a> |
<a href="/fr/mod/mod_rewrite.html" hreflang="fr" rel="alternate" title="Fran�ais"> fr </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&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>
var comments_identifier = 'http://httpd.apache.org/docs/trunk/mod/mod_rewrite.html';
if (w.location.hostname.toLowerCase() == "httpd.apache.org") {
d.write('<div id="comments_thread"><\/div>');
var s = d.createElement('script');
s.type = 'text/javascript';
s.async = true;
s.src = 'http://c.apaste.info/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier;
(d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s);
d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>');
<p class="apache">Copyright 2012 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[//><!--