upload http
[bottlenecks.git] / rubbos / app / httpd-2.0.64 / docs / manual / rewrite / rewrite_intro.html.en
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 Introduction - 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" />
12 <link href="../images/favicon.ico" rel="shortcut icon" /></head>
13 <body id="manual-page"><div id="page-header">
14 <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>
15 <p class="apache">Apache HTTP Server Version 2.0</p>
16 <img alt="" src="../images/feather.gif" /></div>
17 <div class="up"><a href="./index.html"><img title="&lt;-" alt="&lt;-" src="../images/left.gif" /></a></div>
18 <div id="path">
19 <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.0</a></div><div id="page-content"><div id="preamble"><h1>Apache mod_rewrite Introduction</h1>
20 <div class="toplang">
21 <p><span>Available Languages: </span><a href="../en/rewrite/rewrite_intro.html" title="English">&nbsp;en&nbsp;</a></p>
22 </div>
23
24 <p>This document supplements the <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code>
25 <a href="../mod/mod_rewrite.html">reference documentation</a>. It
26 describes the basic concepts necessary for use of
27 <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code>. Other documents go into greater detail,
28 but this doc should help the beginner get their feet wet.
29 </p>
30 </div>
31 <div id="quickview"><ul id="toc"><li><img alt="" src="../images/down.gif" /> <a href="#introduction">Introduction</a></li>
32 <li><img alt="" src="../images/down.gif" /> <a href="#regex">Regular Expressions</a></li>
33 <li><img alt="" src="../images/down.gif" /> <a href="#rewriterule">RewriteRule basics</a></li>
34 <li><img alt="" src="../images/down.gif" /> <a href="#flags">Rewrite Flags</a></li>
35 <li><img alt="" src="../images/down.gif" /> <a href="#rewritecond">Rewrite conditions</a></li>
36 <li><img alt="" src="../images/down.gif" /> <a href="#rewritemap">Rewrite maps</a></li>
37 <li><img alt="" src="../images/down.gif" /> <a href="#htaccess">.htaccess files</a></li>
38 <li><img alt="" src="../images/down.gif" /> <a href="#EnvVar">Environment Variables</a></li>
39 </ul><h3>See also</h3><ul class="seealso"><li><a href="../mod/mod_rewrite.html">Module
40 documentation</a></li><li><a href="rewrite_tech.html">Technical details</a></li><li><a href="rewrite_guide.html">Practical solutions to common
41 problems</a></li></ul></div>
42 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
43 <div class="section">
44 <h2><a name="introduction" id="introduction">Introduction</a></h2>
45 <p>The Apache module <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code> is a very powerful and
46 sophisticated module which provides a way to do URL manipulations. With
47 it, you can do nearly all types of URL rewriting that you may need. It
48 is, however, somewhat complex, and may be intimidating to the beginner.
49 There is also a tendency to treat rewrite rules as magic incantation,
50 using them without actually understanding what they do.</p>
51
52 <p>This document attempts to give sufficient background so that what
53 follows is understood, rather than just copied blindly.
54 </p>
55 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
56 <div class="section">
57 <h2><a name="regex" id="regex">Regular Expressions</a></h2>
58 <p>Basic regex building blocks</p>
59 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
60 <div class="section">
61 <h2><a name="rewriterule" id="rewriterule">RewriteRule basics</a></h2>
62 <p>
63 Basic anatomy of a RewriteRule, with exhaustively annotated simple
64 examples.
65 </p>
66 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
67 <div class="section">
68 <h2><a name="flags" id="flags">Rewrite Flags</a></h2>
69 <p>Discussion of the flags to RewriteRule, and when and why one might
70 use them.</p>
71 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
72 <div class="section">
73 <h2><a name="rewritecond" id="rewritecond">Rewrite conditions</a></h2>
74 <p>Discussion of RewriteCond, looping, and other related concepts.
75 </p>
76 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
77 <div class="section">
78 <h2><a name="rewritemap" id="rewritemap">Rewrite maps</a></h2>
79 <p>Discussion of RewriteMap, including simple, but heavily annotated,
80 examples.</p>
81 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
82 <div class="section">
83 <h2><a name="htaccess" id="htaccess">.htaccess files</a></h2>
84 <p>Discussion of the differences between rewrite rules in httpd.conf and
85 in .htaccess files.</p>
86 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
87 <div class="section">
88 <h2><a name="EnvVar" id="EnvVar">Environment Variables</a></h2>
89
90 <p>This module keeps track of two additional (non-standard)
91 CGI/SSI environment variables named <code>SCRIPT_URL</code>
92 and <code>SCRIPT_URI</code>. These contain the
93 <em>logical</em> Web-view to the current resource, while the
94 standard CGI/SSI variables <code>SCRIPT_NAME</code> and
95 <code>SCRIPT_FILENAME</code> contain the <em>physical</em>
96 System-view. </p>
97
98 <p>Notice: These variables hold the URI/URL <em>as they were
99 initially requested</em>, <em>i.e.</em>, <em>before</em> any
100 rewriting. This is important because the rewriting process is
101 primarily used to rewrite logical URLs to physical
102 pathnames.</p>
103
104 <div class="example"><h3>Example</h3><pre>
105 SCRIPT_NAME=/sw/lib/w3s/tree/global/u/rse/.www/index.html
106 SCRIPT_FILENAME=/u/rse/.www/index.html
107 SCRIPT_URL=/u/rse/
108 SCRIPT_URI=http://en1.engelschall.com/u/rse/
109 </pre></div>
110
111 </div></div>
112 <div class="bottomlang">
113 <p><span>Available Languages: </span><a href="../en/rewrite/rewrite_intro.html" title="English">&nbsp;en&nbsp;</a></p>
114 </div><div id="footer">
115 <p class="apache">Copyright 2009 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>
116 <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>
117 </body></html>