<li><img alt="" src="../images/down.gif" /> <a href="#dbm">dbm: DBM Hash File</a></li>
<li><img alt="" src="../images/down.gif" /> <a href="#int">int: Internal Function</a></li>
<li><img alt="" src="../images/down.gif" /> <a href="#prg">prg: External Rewriting Program</a></li>
-<li><img alt="" src="../images/down.gif" /> <a href="#dbd">dbd or fastdbd: SQL Query</a></li>
<li><img alt="" src="../images/down.gif" /> <a href="#summary">Summary</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="advanced.html">Advanced techniques and tricks</a></li><li><a href="avoid.html">When not to use mod_rewrite</a></li></ul></div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
a context that does not have <code class="directive"><a href="../mod/mod_rewrite.html#rewriteengine">RewriteEngine</a></code> set to
<code>on</code>.</p>
- <p>This feature utilizes the <code>rewrite-map</code> mutex,
- which is required for reliable communication with the program.
- The mutex mechanism and lock file can be configured with the
- <code class="directive"><a href="../mod/core.html#mutex">Mutex</a></code> directive.</p>
-
<p>A simple example is shown here which will replace all dashes with
underscores in a request URI.</p>
</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="section">
-<h2><a name="dbd" id="dbd">dbd or fastdbd: SQL Query</a></h2>
-
-
- <p>When a MapType of <code>dbd</code> or <code>fastdbd</code> is
- used, the MapSource is a SQL SELECT statement that takes a single
- argument and returns a single value.</p>
-
- <p><code class="module"><a href="../mod/mod_dbd.html">mod_dbd</a></code> will need to be configured to point at
- the right database for this statement to be executed.</p>
-
- <p>There are two forms of this MapType.
- Using a MapType of <code>dbd</code> causes the query to be
- executed with each map request, while using <code>fastdbd</code>
- caches the database lookups internally. So, while
- <code>fastdbd</code> is more efficient, and therefore faster, it
- won't pick up on changes to the database until the server is
- restarted.</p>
-
- <p>If a query returns more than one row, a random row from
-the result set is used.</p>
-
- <div class="example"><h3>Example</h3><p><code>
-RewriteMap myquery "fastdbd:SELECT destination FROM rewrite WHERE source = %s"
- </code></p></div>
-
- </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
-<div class="section">
<h2><a name="summary" id="summary">Summary</a></h2>
module="mod_rewrite">RewriteEngine</directive> set to
<code>on</code>.</p>
- <p>This feature utilizes the <code>rewrite-map</code> mutex,
- which is required for reliable communication with the program.
- The mutex mechanism and lock file can be configured with the
- <directive module="core">Mutex</directive> directive.</p>
-
<p>A simple example is shown here which will replace all dashes with
underscores in a request URI.</p>
</section>
-
- <section id="dbd">
- <title>dbd or fastdbd: SQL Query</title>
-
- <p>When a MapType of <code>dbd</code> or <code>fastdbd</code> is
- used, the MapSource is a SQL SELECT statement that takes a single
- argument and returns a single value.</p>
-
- <p><module>mod_dbd</module> will need to be configured to point at
- the right database for this statement to be executed.</p>
-
- <p>There are two forms of this MapType.
- Using a MapType of <code>dbd</code> causes the query to be
- executed with each map request, while using <code>fastdbd</code>
- caches the database lookups internally. So, while
- <code>fastdbd</code> is more efficient, and therefore faster, it
- won't pick up on changes to the database until the server is
- restarted.</p>
-
- <p>If a query returns more than one row, a random row from
-the result set is used.</p>
-
- <example><title>Example</title>
-RewriteMap myquery "fastdbd:SELECT destination FROM rewrite WHERE source = %s"
- </example>
-
- </section>
<section id="summary">
<title>Summary</title>