summaryrefslogtreecommitdiff
path: root/docs/manual/urlmapping.html.en
diff options
context:
space:
mode:
authorDaniel Gruno <humbedooh@apache.org>2012-05-04 15:45:05 +0000
committerDaniel Gruno <humbedooh@apache.org>2012-05-04 15:45:05 +0000
commitf38fefce1600fe88c042e665770bcaa066331c2d (patch)
treee17764804d29ee55e59f26913ab599054a8fec9a /docs/manual/urlmapping.html.en
parente618c6e4490c9dc5c84154080ff697cf7e79f175 (diff)
downloadhttpd-f38fefce1600fe88c042e665770bcaa066331c2d.tar.gz
xforms
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1334039 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'docs/manual/urlmapping.html.en')
-rw-r--r--docs/manual/urlmapping.html.en45
1 files changed, 29 insertions, 16 deletions
diff --git a/docs/manual/urlmapping.html.en b/docs/manual/urlmapping.html.en
index ed9a5a4d3e..a40718e732 100644
--- a/docs/manual/urlmapping.html.en
+++ b/docs/manual/urlmapping.html.en
@@ -94,7 +94,8 @@
<p>Alternatively, the <code class="directive"><a href="./mod/mod_alias.html#alias">Alias</a></code> directive will map any part
of the filesystem into the web space. For example, with</p>
-<div class="example"><p><code>Alias /docs /var/web</code></p></div>
+<pre class="prettyprint lang-config">Alias /docs /var/web</pre>
+
<p>the URL <code>http://www.example.com/docs/dir/file.html</code>
will be served from <code>/var/web/dir/file.html</code>. The
@@ -109,8 +110,10 @@
expression</a> based matching and substitution. For
example,</p>
-<div class="example"><p><code>ScriptAliasMatch ^/~([a-zA-Z0-9]+)/cgi-bin/(.+)
- /home/$1/cgi-bin/$2</code></p></div>
+ <pre class="prettyprint lang-config">
+ ScriptAliasMatch ^/~([a-zA-Z0-9]+)/cgi-bin/(.+) /home/$1/cgi-bin/$2
+ </pre>
+
<p>will map a request to
<code>http://example.com/~user/cgi-bin/script.cgi</code> to the
@@ -156,8 +159,10 @@
<code>/home/user/public_html/file.html</code>, use the following
<code>AliasMatch</code> directive:</p>
-<div class="example"><p><code>AliasMatch ^/upages/([a-zA-Z0-9]+)(/(.*))?$
- /home/$1/public_html/$3</code></p></div>
+ <pre class="prettyprint lang-config">
+ AliasMatch ^/upages/([a-zA-Z0-9]+)(/(.*))?$ /home/$1/public_html/$3
+ </pre>
+
</div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div>
<div class="section">
<h2><a name="redirect" id="redirect">URL Redirection</a></h2>
@@ -174,8 +179,10 @@
to the new directory <code>/bar/</code>, you can instruct clients
to request the content at the new location as follows:</p>
-<div class="example"><p><code>Redirect permanent /foo/
- http://www.example.com/bar/</code></p></div>
+ <pre class="prettyprint lang-config">
+ Redirect permanent /foo/ http://www.example.com/bar/
+ </pre>
+
<p>This will redirect any URL-Path starting in
<code>/foo/</code> to the same URL path on the
@@ -188,14 +195,18 @@
for the site home page to a different site, but leave all other
requests alone, use the following configuration:</p>
-<div class="example"><p><code>RedirectMatch permanent ^/$
- http://www.example.com/startpage.html</code></p></div>
+ <pre class="prettyprint lang-config">
+ RedirectMatch permanent ^/$ http://www.example.com/startpage.html
+ </pre>
+
<p>Alternatively, to temporarily redirect all pages on one site
to a particular page on another site, use the following:</p>
-<div class="example"><p><code>RedirectMatch temp .*
- http://othersite.example.com/startpage.html</code></p></div>
+ <pre class="prettyprint lang-config">
+ RedirectMatch temp .* http://othersite.example.com/startpage.html
+ </pre>
+
</div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div>
<div class="section">
<h2><a name="proxy" id="proxy">Reverse Proxy</a></h2>
@@ -213,12 +224,13 @@ the <code>/bar/</code> directory on <code>internal.example.com</code>
and returns them to the client as if they were from the local
server.</p>
-<div class="example"><p><code>
+<pre class="prettyprint lang-config">
ProxyPass /foo/ http://internal.example.com/bar/<br />
ProxyPassReverse /foo/ http://internal.example.com/bar/<br />
ProxyPassReverseCookieDomain internal.example.com public.example.com<br />
ProxyPassReverseCookiePath /foo/ /bar/
-</code></p></div>
+</pre>
+
<p>The <code class="directive"><a href="./mod/mod_proxy.html#proxypass">ProxyPass</a></code> configures
the server to fetch the appropriate documents, while the
@@ -237,11 +249,12 @@ breaking out of the proxy server and requesting directly from
content) in a page as it is being served to the client using
<code class="module"><a href="./mod/mod_substitute.html">mod_substitute</a></code>.</p>
-<div class="example"><p><code>
+<pre class="prettyprint lang-config">
Substitute s/internal\.example\.com/www.example.com/i
-</code></p></div>
+</pre>
+
-<p>For more sophisticated rewriting of links in HTML and XHTML, the
+<p>For more sophisticated rewriting of links in HTML and XHTML, the
<code class="module"><a href="./mod/mod_proxy_html.html">mod_proxy_html</a></code> module is also available. It allows you
to create maps of URLs that need to be rewritten, so that complex
proxying scenarios can be handled.</p>