index.html.en revision af33a4994ae2ff15bc67d19ff1a7feb906745bf8
22a41ae508535e87c3c2270202ae78de6ac4672crbowen<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
22a41ae508535e87c3c2270202ae78de6ac4672crbowen<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><!--
22a41ae508535e87c3c2270202ae78de6ac4672crbowen XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
22a41ae508535e87c3c2270202ae78de6ac4672crbowen This file is generated from xml source: DO NOT EDIT
22a41ae508535e87c3c2270202ae78de6ac4672crbowen XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
22a41ae508535e87c3c2270202ae78de6ac4672crbowen<title>Apache mod_rewrite - Apache HTTP Server</title>
22a41ae508535e87c3c2270202ae78de6ac4672crbowen<link href="/style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
22a41ae508535e87c3c2270202ae78de6ac4672crbowen<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" />
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen<script src="/style/scripts/prettify.js" type="text/javascript">
22a41ae508535e87c3c2270202ae78de6ac4672crbowen<link href="/images/favicon.ico" rel="shortcut icon" /></head>
af33a4994ae2ff15bc67d19ff1a7feb906745bf8rbowen<p class="menu"><a href="/mod/">Modules</a> | <a href="/mod/quickreference.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>
22a41ae508535e87c3c2270202ae78de6ac4672crbowen<div class="up"><a href="../"><img title="<-" alt="<-" src="/images/left.gif" /></a></div>
3f08db06526d6901aa08c110b5bc7dde6bc39905nd<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></div><div id="page-content"><div id="preamble"><h1>Apache mod_rewrite</h1>
f3ec420152ca921e4c1ce77782f51b53f659018dnd<p><span>Available Languages: </span><a href="/en/rewrite/" title="English"> en </a> |
bd2feb86ee6d8c91ecd992138ceb96a7069a5578gryzor<a href="/fr/rewrite/" hreflang="fr" rel="alternate" title="Fran�ais"> fr </a> |
d474d8ef01ec5c2a09341cd148851ed383c3287crbowen<a href="/tr/rewrite/" hreflang="tr" rel="alternate" title="T�rk�e"> tr </a> |
d474d8ef01ec5c2a09341cd148851ed383c3287crbowen<a href="/zh-cn/rewrite/" hreflang="zh-cn" rel="alternate" title="Simplified Chinese"> zh-cn </a></p>
ef96a16f2c3ed821e516840775560b4895b26d3drbowen <p><code class="module"><a href="/mod/mod_rewrite.html">mod_rewrite</a></code> provides a way to modify incoming
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf URL requests, dynamically, based on <a href="intro.html#regex">regular
ef96a16f2c3ed821e516840775560b4895b26d3drbowen expression</a> rules. This allows you to map arbitrary URLs onto
ef96a16f2c3ed821e516840775560b4895b26d3drbowen your internal URL structure in any way you like.</p>
ef96a16f2c3ed821e516840775560b4895b26d3drbowen <p>It supports an unlimited number of rules and an
22a41ae508535e87c3c2270202ae78de6ac4672crbowen unlimited number of attached rule conditions for each rule to
22a41ae508535e87c3c2270202ae78de6ac4672crbowen provide a really flexible and powerful URL manipulation
0b1f1f5b70f1d4df3b6a6eb4c92f6869719dc711rbowen mechanism. The URL manipulations can depend on various tests:
0b1f1f5b70f1d4df3b6a6eb4c92f6869719dc711rbowen server variables, environment variables, HTTP
ef96a16f2c3ed821e516840775560b4895b26d3drbowen headers, time stamps, external database lookups, and various other
ef96a16f2c3ed821e516840775560b4895b26d3drbowen external programs or handlers, can be used to achieve granular URL
22a41ae508535e87c3c2270202ae78de6ac4672crbowen matching.</p>
0b1f1f5b70f1d4df3b6a6eb4c92f6869719dc711rbowen <p>Rewrite rules can operate on the full URLs, including the path-info
0b1f1f5b70f1d4df3b6a6eb4c92f6869719dc711rbowen and query string portions, and may be used in per-server context
0b1f1f5b70f1d4df3b6a6eb4c92f6869719dc711rbowen (<code>httpd.conf</code>), per-virtualhost context (<code class="directive"><a href="/mod/core.html#virtualhost"><VirtualHost></a></code> blocks), or
0b1f1f5b70f1d4df3b6a6eb4c92f6869719dc711rbowen per-directory context (<code>.htaccess</code> files and <code class="directive"><a href="/mod/core.html#directory"><Directory></a></code> blocks). The
0b1f1f5b70f1d4df3b6a6eb4c92f6869719dc711rbowen rewritten result can lead to further rules, internal
0b1f1f5b70f1d4df3b6a6eb4c92f6869719dc711rbowen sub-processing, external request redirection, or proxy
ef96a16f2c3ed821e516840775560b4895b26d3drbowen passthrough, depending on what <a href="flags.html">flags</a> you
ef96a16f2c3ed821e516840775560b4895b26d3drbowen attach to the rules.</p>
0b1f1f5b70f1d4df3b6a6eb4c92f6869719dc711rbowen <p>Since mod_rewrite is so powerful, it can indeed be rather
0b1f1f5b70f1d4df3b6a6eb4c92f6869719dc711rbowen complex. This document supplements the <a href="/mod/mod_rewrite.html">reference documentation</a>, and
0b1f1f5b70f1d4df3b6a6eb4c92f6869719dc711rbowen attempts to allay some of that complexity, and provide highly
522bde10e5e1e579697bf49d992d163b7d54f3b0humbedooh annotated examples of common scenarios that you may handle with
0b1f1f5b70f1d4df3b6a6eb4c92f6869719dc711rbowen mod_rewrite. But we also attempt to show you when you should not
0b1f1f5b70f1d4df3b6a6eb4c92f6869719dc711rbowen use mod_rewrite, and use other standard Apache features instead,
0b1f1f5b70f1d4df3b6a6eb4c92f6869719dc711rbowen thus avoiding this unnecessary complexity.</p>
f3f7fbd152943fb15146b438ec8a4c39c404a2fbrbowen<li><a href="/mod/mod_rewrite.html">mod_rewrite reference
5f8a7d39ae7cbbdd9738d1d8ae7ee0cb35671932rbowen<li><a href="intro.html">Introduction to regular expressions and mod_rewrite</a></li>
5f8a7d39ae7cbbdd9738d1d8ae7ee0cb35671932rbowen<li><a href="remapping.html">Using mod_rewrite for redirection and remapping of URLs</a></li>
06ed4d71350dacf8c4bedec7ac850eeb9a84637arbowen<li><a href="access.html">Using mod_rewrite to control access</a></li>
5f8a7d39ae7cbbdd9738d1d8ae7ee0cb35671932rbowen<li><a href="vhosts.html">Dynamic virtual hosts with mod_rewrite</a></li>
5f8a7d39ae7cbbdd9738d1d8ae7ee0cb35671932rbowen<li><a href="proxy.html">Dynamic proxying with mod_rewrite</a></li>
3723c5ef4beec0403b4daa6c64fc0a8f53541018rbowen<li><a href="rewritemap.html">Using RewriteMap</a></li>
53abc235688d883cfa15cdfec354ba03128f357arbowen<li><a href="advanced.html">Advanced techniques</a></li>
5f8a7d39ae7cbbdd9738d1d8ae7ee0cb35671932rbowen<li><a href="avoid.html">When <strong>NOT</strong> to use mod_rewrite</a></li>
1093a264c81aa1041581ab059905fb8f7cdfc5e2rbowen<div id="quickview"><h3>See also</h3><ul class="seealso"><li><a href="/mod/mod_rewrite.html">mod_rewrite reference
1093a264c81aa1041581ab059905fb8f7cdfc5e2rbowendocumentation</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
1093a264c81aa1041581ab059905fb8f7cdfc5e2rbowenwiki</a></li><li><a href="/glossary.html">Glossary</a></li></ul></div>
f3ec420152ca921e4c1ce77782f51b53f659018dnd<p><span>Available Languages: </span><a href="/en/rewrite/" title="English"> en </a> |
bd2feb86ee6d8c91ecd992138ceb96a7069a5578gryzor<a href="/fr/rewrite/" hreflang="fr" rel="alternate" title="Fran�ais"> fr </a> |
d474d8ef01ec5c2a09341cd148851ed383c3287crbowen<a href="/tr/rewrite/" hreflang="tr" rel="alternate" title="T�rk�e"> tr </a> |
d474d8ef01ec5c2a09341cd148851ed383c3287crbowen<a href="/zh-cn/rewrite/" hreflang="zh-cn" rel="alternate" title="Simplified Chinese"> zh-cn </a></p>
1a1356f375e36db7bee379ea0684ab389579f798rbowen<p class="apache">Copyright 2013 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>
af33a4994ae2ff15bc67d19ff1a7feb906745bf8rbowen<p class="menu"><a href="/mod/">Modules</a> | <a href="/mod/quickreference.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[//><!--
0d0ba3a410038e179b695446bb149cce6264e0abndif (typeof(prettyPrint) !== 'undefined') {
7fec19672a491661b2fe4b29f685bc7f4efa64d4nd prettyPrint();