index.html.en revision 522bde10e5e1e579697bf49d992d163b7d54f3b0
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd<?xml version="1.0" encoding="ISO-8859-1"?>
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><!--
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd This file is generated from xml source: DO NOT EDIT
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd -->
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd<title>Apache mod_rewrite - Apache HTTP Server</title>
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd<link href="/style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd<link href="/style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd<link href="/style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" />
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd<link href="/images/favicon.ico" rel="shortcut icon" /></head>
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd<body id="manual-page"><div id="page-header">
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd<p class="menu"><a href="/mod/">Modules</a> | <a href="/mod/directives.html">Directives</a> | <a href="/faq/">FAQ</a> | <a href="/glossary.html">Glossary</a> | <a href="/sitemap.html">Sitemap</a></p>
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd<p class="apache">Apache HTTP Server Version 2.5</p>
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd<img alt="" src="/images/feather.gif" /></div>
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd<div class="up"><a href="../"><img title="&lt;-" alt="&lt;-" src="/images/left.gif" /></a></div>
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd<div id="path">
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd<a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs/">Documentation</a> &gt; <a href="../">Version 2.5</a></div><div id="page-content"><div id="preamble"><h1>Apache mod_rewrite</h1>
4b6b68ba97661e61b45440c2e520a1fed92169e2nd<div class="toplang">
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd<p><span>Available Languages: </span><a href="/en/rewrite/" title="English">&nbsp;en&nbsp;</a> |
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd<a href="/fr/rewrite/" hreflang="fr" rel="alternate" title="Fran�ais">&nbsp;fr&nbsp;</a> |
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd<a href="/tr/rewrite/" hreflang="tr" rel="alternate" title="T�rk�e">&nbsp;tr&nbsp;</a> |
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd<a href="/zh-cn/rewrite/" hreflang="zh-cn" rel="alternate" title="Simplified Chinese">&nbsp;zh-cn&nbsp;</a></p>
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd</div>
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd <p><code class="module"><a href="/mod/mod_rewrite.html">mod_rewrite</a></code> provides a way to modify incoming
4930be147adf9e3f6d3ca9313a6524f9bf654b2dnd URL requests, dynamically, based on <a href="intro.html#regex">regular
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd expression</a> rules. This allows you to map arbitrary URLs onto
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd your internal URL structure in any way you like.</p>
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd <p>It supports an unlimited number of rules and an
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd unlimited number of attached rule conditions for each rule to
4930be147adf9e3f6d3ca9313a6524f9bf654b2dnd provide a really flexible and powerful URL manipulation
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd mechanism. The URL manipulations can depend on various tests:
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd server variables, environment variables, HTTP
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd headers, time stamps, external database lookups, and various other
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd external programs or handlers, can be used to achieve granular URL
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd matching.</p>
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd <p>Rewrite rules can operate on the full URLs, including the path-info
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd and query string portions, and may be used in per-server context
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd (<code>httpd.conf</code>), per-virtualhost context (<code class="directive"><a href="/mod/core.html#virtualhost">&lt;VirtualHost&gt;</a></code> blocks), or
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd per-directory context (<code>.htaccess</code> files and <code class="directive"><a href="/mod/core.html#directory">&lt;Directory&gt;</a></code> blocks). The
4b6b68ba97661e61b45440c2e520a1fed92169e2nd rewritten result can lead to further rules, internal
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd sub-processing, external request redirection, or proxy
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd passthrough, depending on what <a href="flags.html">flags</a> you
4b6b68ba97661e61b45440c2e520a1fed92169e2nd attach to the rules.</p>
4b6b68ba97661e61b45440c2e520a1fed92169e2nd
4b6b68ba97661e61b45440c2e520a1fed92169e2nd <p>Since mod_rewrite is so powerful, it can indeed be rather
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd complex. This document supplements the <a href="/mod/mod_rewrite.html">reference documentation</a>, and
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd attempts to allay some of that complexity, and provide highly
4b6b68ba97661e61b45440c2e520a1fed92169e2nd annotated examples of common scenarios that you may handle with
4b6b68ba97661e61b45440c2e520a1fed92169e2nd mod_rewrite. But we also attempt to show you when you should not
4b6b68ba97661e61b45440c2e520a1fed92169e2nd use mod_rewrite, and use other standard Apache features instead,
4b6b68ba97661e61b45440c2e520a1fed92169e2nd thus avoiding this unnecessary complexity.</p>
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd<ul>
4b6b68ba97661e61b45440c2e520a1fed92169e2nd<li><a href="/mod/mod_rewrite.html">mod_rewrite reference
6e6cc280299826341f2e79ad56134d763a54fe43nddocumentation</a></li>
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd<li><a href="intro.html">Introduction to regular expressions and mod_rewrite</a></li>
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd<li><a href="remapping.html">Using mod_rewrite for redirection and remapping of URLs</a></li>
4b6b68ba97661e61b45440c2e520a1fed92169e2nd<li><a href="access.html">Using mod_rewrite to control access</a></li>
4b6b68ba97661e61b45440c2e520a1fed92169e2nd<li><a href="vhosts.html">Dynamic virtual hosts with mod_rewrite</a></li>
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd<li><a href="proxy.html">Dynamic proxying with mod_rewrite</a></li>
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd<li><a href="rewritemap.html">Using RewriteMap</a></li>
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd<li><a href="advanced.html">Advanced techniques</a></li>
4b6b68ba97661e61b45440c2e520a1fed92169e2nd<li><a href="avoid.html">When <strong>NOT</strong> to use mod_rewrite</a></li>
4b6b68ba97661e61b45440c2e520a1fed92169e2nd<li><a href="flags.html">RewriteRule Flags</a></li>
f5e4573f2a3ca4b7d7d10bfb50950fa7eff27efbnilgun<li><a href="tech.html">Technical details</a></li>
f5e4573f2a3ca4b7d7d10bfb50950fa7eff27efbnilgun</ul>
f5e4573f2a3ca4b7d7d10bfb50950fa7eff27efbnilgun</div>
f5e4573f2a3ca4b7d7d10bfb50950fa7eff27efbnilgun<div id="quickview"><h3>See also</h3><ul class="seealso"><li><a href="/mod/mod_rewrite.html">mod_rewrite reference
008ab149b6efb915d8e0034c0b8266f8c3e3f872nddocumentation</a></li><li><a href="/urlmapping.html">Mapping URLs to the Filesystem</a></li><li><a href="http://wiki.apache.org/httpd/Rewrite">mod_rewrite
008ab149b6efb915d8e0034c0b8266f8c3e3f872ndwiki</a></li><li><a href="/glossary.html">Glossary</a></li></ul></div>
4b6b68ba97661e61b45440c2e520a1fed92169e2nd</div>
4b6b68ba97661e61b45440c2e520a1fed92169e2nd<div class="bottomlang">
4b6b68ba97661e61b45440c2e520a1fed92169e2nd<p><span>Available Languages: </span><a href="/en/rewrite/" title="English">&nbsp;en&nbsp;</a> |
4b6b68ba97661e61b45440c2e520a1fed92169e2nd<a href="/fr/rewrite/" hreflang="fr" rel="alternate" title="Fran�ais">&nbsp;fr&nbsp;</a> |
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd<a href="/tr/rewrite/" hreflang="tr" rel="alternate" title="T�rk�e">&nbsp;tr&nbsp;</a> |
4b6b68ba97661e61b45440c2e520a1fed92169e2nd<a href="/zh-cn/rewrite/" hreflang="zh-cn" rel="alternate" title="Simplified Chinese">&nbsp;zh-cn&nbsp;</a></p>
4930be147adf9e3f6d3ca9313a6524f9bf654b2dnd</div><div id="footer">
4930be147adf9e3f6d3ca9313a6524f9bf654b2dnd<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>
4930be147adf9e3f6d3ca9313a6524f9bf654b2dnd<p class="menu"><a href="/mod/">Modules</a> | <a href="/mod/directives.html">Directives</a> | <a href="/faq/">FAQ</a> | <a href="/glossary.html">Glossary</a> | <a href="/sitemap.html">Sitemap</a></p></div>
4930be147adf9e3f6d3ca9313a6524f9bf654b2dnd</body></html>