1<?xml version="1.0" encoding="ISO-8859-1"?> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 3<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><!-- 4 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 5 This file is generated from xml source: DO NOT EDIT 6 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 7 --> 8<title>Apache mod_rewrite - Apache HTTP Server</title> 9<link href="/style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" /> 10<link href="/style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" /> 11<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" /> 12<script src="/style/scripts/prettify.min.js" type="text/javascript"> 13</script> 14 15<link href="/images/favicon.ico" rel="shortcut icon" /></head> 16<body id="manual-page"><div id="page-header"> 17<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> 18<p class="apache">Apache HTTP Server Version 2.4</p> 19<img alt="" src="/images/feather.gif" /></div> 20<div class="up"><a href="../"><img title="<-" alt="<-" src="/images/left.gif" /></a></div> 21<div id="path"> 22<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.4</a></div><div id="page-content"><div id="preamble"><h1>Apache mod_rewrite</h1> 23<div class="toplang"> 24<p><span>Available Languages: </span><a href="/en/rewrite/" title="English"> en </a> | 25<a href="/fr/rewrite/" hreflang="fr" rel="alternate" title="Fran�ais"> fr </a> | 26<a href="/tr/rewrite/" hreflang="tr" rel="alternate" title="T�rk�e"> tr </a> | 27<a href="/zh-cn/rewrite/" hreflang="zh-cn" rel="alternate" title="Simplified Chinese"> zh-cn </a></p> 28</div> 29 30 31 <p><code class="module"><a href="/mod/mod_rewrite.html">mod_rewrite</a></code> provides a way to modify incoming 32 URL requests, dynamically, based on <a href="intro.html#regex">regular 33 expression</a> rules. This allows you to map arbitrary URLs onto 34 your internal URL structure in any way you like.</p> 35 36 <p>It supports an unlimited number of rules and an 37 unlimited number of attached rule conditions for each rule to 38 provide a really flexible and powerful URL manipulation 39 mechanism. The URL manipulations can depend on various tests: 40 server variables, environment variables, HTTP 41 headers, time stamps, external database lookups, and various other 42 external programs or handlers, can be used to achieve granular URL 43 matching.</p> 44 45 <p>Rewrite rules can operate on the full URLs, including the path-info 46 and query string portions, and may be used in per-server context 47 (<code>httpd.conf</code>), per-virtualhost context (<code class="directive"><a href="/mod/core.html#virtualhost"><VirtualHost></a></code> blocks), or 48 per-directory context (<code>.htaccess</code> files and <code class="directive"><a href="/mod/core.html#directory"><Directory></a></code> blocks). The 49 rewritten result can lead to further rules, internal 50 sub-processing, external request redirection, or proxy 51 passthrough, depending on what <a href="flags.html">flags</a> you 52 attach to the rules.</p> 53 54 <p>Since mod_rewrite is so powerful, it can indeed be rather 55 complex. This document supplements the <a href="/mod/mod_rewrite.html">reference documentation</a>, and 56 attempts to allay some of that complexity, and provide highly 57 annotated examples of common scenarios that you may handle with 58 mod_rewrite. But we also attempt to show you when you should not 59 use mod_rewrite, and use other standard Apache features instead, 60 thus avoiding this unnecessary complexity.</p> 61 62 63<ul> 64<li><a href="/mod/mod_rewrite.html">mod_rewrite reference 65documentation</a></li> 66<li><a href="intro.html">Introduction to regular expressions and mod_rewrite</a></li> 67<li><a href="remapping.html">Using mod_rewrite for redirection and remapping of URLs</a></li> 68<li><a href="access.html">Using mod_rewrite to control access</a></li> 69<li><a href="vhosts.html">Dynamic virtual hosts with mod_rewrite</a></li> 70<li><a href="proxy.html">Dynamic proxying with mod_rewrite</a></li> 71<li><a href="rewritemap.html">Using RewriteMap</a></li> 72<li><a href="advanced.html">Advanced techniques</a></li> 73<li><a href="avoid.html">When <strong>NOT</strong> to use mod_rewrite</a></li> 74<li><a href="flags.html">RewriteRule Flags</a></li> 75<li><a href="tech.html">Technical details</a></li> 76</ul> 77</div> 78<div id="quickview"><h3>See also</h3><ul class="seealso"><li><a href="/mod/mod_rewrite.html">mod_rewrite reference 79documentation</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 80wiki</a></li><li><a href="/glossary.html">Glossary</a></li></ul></div> 81</div> 82<div class="bottomlang"> 83<p><span>Available Languages: </span><a href="/en/rewrite/" title="English"> en </a> | 84<a href="/fr/rewrite/" hreflang="fr" rel="alternate" title="Fran�ais"> fr </a> | 85<a href="/tr/rewrite/" hreflang="tr" rel="alternate" title="T�rk�e"> tr </a> | 86<a href="/zh-cn/rewrite/" hreflang="zh-cn" rel="alternate" title="Simplified Chinese"> zh-cn </a></p> 87</div><div id="footer"> 88<p class="apache">Copyright 2014 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> 89<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[//><!-- 90if (typeof(prettyPrint) !== 'undefined') { 91 prettyPrint(); 92} 93//--><!]]></script> 94</body></html>