index.html.en revision 522bde10e5e1e579697bf49d992d163b7d54f3b0
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<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<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<div class="up"><a href="../"><img title="<-" alt="<-" src="/images/left.gif" /></a></div>
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd<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>
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd<p><span>Available Languages: </span><a href="/en/rewrite/" title="English"> en </a> |
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd<a href="/fr/rewrite/" hreflang="fr" rel="alternate" title="Fran�ais"> fr </a> |
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd<a href="/tr/rewrite/" hreflang="tr" rel="alternate" title="T�rk�e"> tr </a> |
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd<a href="/zh-cn/rewrite/" hreflang="zh-cn" rel="alternate" title="Simplified Chinese"> zh-cn </a></p>
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 <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 <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"><VirtualHost></a></code> blocks), or
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd per-directory context (<code>.htaccess</code> files and <code class="directive"><a href="/mod/core.html#directory"><Directory></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 <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<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>
4b6b68ba97661e61b45440c2e520a1fed92169e2nd<li><a href="avoid.html">When <strong>NOT</strong> to use mod_rewrite</a></li>
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<p><span>Available Languages: </span><a href="/en/rewrite/" title="English"> en </a> |
4b6b68ba97661e61b45440c2e520a1fed92169e2nd<a href="/fr/rewrite/" hreflang="fr" rel="alternate" title="Fran�ais"> fr </a> |
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd<a href="/tr/rewrite/" hreflang="tr" rel="alternate" title="T�rk�e"> tr </a> |
4b6b68ba97661e61b45440c2e520a1fed92169e2nd<a href="/zh-cn/rewrite/" hreflang="zh-cn" rel="alternate" title="Simplified Chinese"> zh-cn </a></p>
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>