
rbowen at apache
Nov 4, 2009, 5:55 PM
Post #1 of 1
(69 views)
Permalink
|
|
svn commit: r832973 - in /httpd/httpd/trunk/docs/manual/rewrite: index.xml.tr remapping.html.en remapping.xml rewrite_guide.html.en rewrite_guide.xml
|
|
Author: rbowen Date: Thu Nov 5 01:55:43 2009 New Revision: 832973 URL: http://svn.apache.org/viewvc?rev=832973&view=rev Log: Moves the 'browser-specific' rule into remapping. Modified: httpd/httpd/trunk/docs/manual/rewrite/index.xml.tr httpd/httpd/trunk/docs/manual/rewrite/remapping.html.en httpd/httpd/trunk/docs/manual/rewrite/remapping.xml httpd/httpd/trunk/docs/manual/rewrite/rewrite_guide.html.en httpd/httpd/trunk/docs/manual/rewrite/rewrite_guide.xml Modified: httpd/httpd/trunk/docs/manual/rewrite/index.xml.tr URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/rewrite/index.xml.tr?rev=832973&r1=832972&r2=832973&view=diff ============================================================================== --- httpd/httpd/trunk/docs/manual/rewrite/index.xml.tr [utf-8] (original) +++ httpd/httpd/trunk/docs/manual/rewrite/index.xml.tr [utf-8] Thu Nov 5 01:55:43 2009 @@ -1,7 +1,7 @@ <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd"> <?xml-stylesheet type="text/xsl" href="../style/manual.tr.xsl"?> -<!-- English Revision: 636374:832217 (outdated) --> +<!-- English Revision: 636374:832962 (outdated) --> <!-- ===================================================== Translated by: Nilgün Belma Bugüner <nilgun belgeler.org> Reviewed by: Orhan Berent <berent belgeler.org> Modified: httpd/httpd/trunk/docs/manual/rewrite/remapping.html.en URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/rewrite/remapping.html.en?rev=832973&r1=832972&r2=832973&view=diff ============================================================================== --- httpd/httpd/trunk/docs/manual/rewrite/remapping.html.en (original) +++ httpd/httpd/trunk/docs/manual/rewrite/remapping.html.en Thu Nov 5 01:55:43 2009 @@ -42,6 +42,7 @@ <li><img alt="" src="../images/down.gif" /> <a href="#canonicalhost">Canonical Hostnames</a></li> <li><img alt="" src="../images/down.gif" /> <a href="#multipledirs">Search for pages in more than one directory</a></li> <li><img alt="" src="../images/down.gif" /> <a href="#archive-access-multiplexer">Redirecting to Geographically Distributed Servers</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#browser-dependent-content">Browser Dependent Content</a></li> </ul><h3>See also</h3><ul class="seealso"><li><a href="../mod/mod_rewrite.html">Module documentation</a></li><li><a href="intro.html">mod_rewrite introduction</a></li></ul></div> <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> <div class="section"> @@ -396,6 +397,46 @@ </dd> </dl> +</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="browser-dependent-content" id="browser-dependent-content">Browser Dependent Content</a></h2> + + + + <dl> + <dt>Description:</dt> + + <dd> + <p>We wish to provide different content based on the browser, or + user-agent, which is requesting the content.</p> + </dd> + + <dt>Solution:</dt> + + <dd> + <p>We have to decide, based on the HTTP header "User-Agent", + which content to serve. The following config + does the following: If the HTTP header "User-Agent" + contains "Mozilla/3", the page <code>foo.html</code> + is rewritten to <code>foo.NS.html</code> and the + rewriting stops. If the browser is "Lynx" or "Mozilla" of + version 1 or 2, the URL becomes <code>foo.20.html</code>. + All other browsers receive page <code>foo.32.html</code>. + This is done with the following ruleset:</p> + +<div class="example"><pre> +RewriteCond %{HTTP_USER_AGENT} ^<strong>Mozilla/3</strong>.* +RewriteRule ^foo\.html$ foo.<strong>NS</strong>.html [<strong>L</strong>] + +RewriteCond %{HTTP_USER_AGENT} ^<strong>Lynx/</strong>.* [OR] +RewriteCond %{HTTP_USER_AGENT} ^<strong>Mozilla/[12]</strong>.* +RewriteRule ^foo\.html$ foo.<strong>20</strong>.html [<strong>L</strong>] + +RewriteRule ^foo\.html$ foo.<strong>32</strong>.html [<strong>L</strong>] +</pre></div> + </dd> + </dl> + </div></div> <div class="bottomlang"> <p><span>Available Languages: </span><a href="../en/rewrite/remapping.html" title="English"> en </a></p> Modified: httpd/httpd/trunk/docs/manual/rewrite/remapping.xml URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/rewrite/remapping.xml?rev=832973&r1=832972&r2=832973&view=diff ============================================================================== --- httpd/httpd/trunk/docs/manual/rewrite/remapping.xml (original) +++ httpd/httpd/trunk/docs/manual/rewrite/remapping.xml Thu Nov 5 01:55:43 2009 @@ -400,5 +400,44 @@ </section> +<section id="browser-dependent-content"> + + <title>Browser Dependent Content</title> + + <dl> + <dt>Description:</dt> + + <dd> + <p>We wish to provide different content based on the browser, or + user-agent, which is requesting the content.</p> + </dd> + + <dt>Solution:</dt> + + <dd> + <p>We have to decide, based on the HTTP header "User-Agent", + which content to serve. The following config + does the following: If the HTTP header "User-Agent" + contains "Mozilla/3", the page <code>foo.html</code> + is rewritten to <code>foo.NS.html</code> and the + rewriting stops. If the browser is "Lynx" or "Mozilla" of + version 1 or 2, the URL becomes <code>foo.20.html</code>. + All other browsers receive page <code>foo.32.html</code>. + This is done with the following ruleset:</p> + +<example><pre> +RewriteCond %{HTTP_USER_AGENT} ^<strong>Mozilla/3</strong>.* +RewriteRule ^foo\.html$ foo.<strong>NS</strong>.html [<strong>L</strong>] + +RewriteCond %{HTTP_USER_AGENT} ^<strong>Lynx/</strong>.* [OR] +RewriteCond %{HTTP_USER_AGENT} ^<strong>Mozilla/[12]</strong>.* +RewriteRule ^foo\.html$ foo.<strong>20</strong>.html [<strong>L</strong>] + +RewriteRule ^foo\.html$ foo.<strong>32</strong>.html [<strong>L</strong>] +</pre></example> + </dd> + </dl> + +</section> </manualpage> Modified: httpd/httpd/trunk/docs/manual/rewrite/rewrite_guide.html.en URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/rewrite/rewrite_guide.html.en?rev=832973&r1=832972&r2=832973&view=diff ============================================================================== --- httpd/httpd/trunk/docs/manual/rewrite/rewrite_guide.html.en (original) +++ httpd/httpd/trunk/docs/manual/rewrite/rewrite_guide.html.en Thu Nov 5 01:55:43 2009 @@ -50,9 +50,7 @@ <li><img alt="" src="../images/down.gif" /> <a href="#redirectanchors">Redirecting Anchors</a></li> <li><img alt="" src="../images/down.gif" /> <a href="#time-dependent">Time-Dependent Rewriting</a></li> <li><img alt="" src="../images/down.gif" /> <a href="#external-rewriting">External Rewriting Engine</a></li> -<li><img alt="" src="../images/down.gif" /> <a href="#cluster">URL-based sharding accross multiple backends</a></li> <li><img alt="" src="../images/down.gif" /> <a href="#structuredhomedirs">Structured Homedirs</a></li> -<li><img alt="" src="../images/down.gif" /> <a href="#browser-dependent-content">Browser Dependent Content</a></li> <li><img alt="" src="../images/down.gif" /> <a href="#dynamic-mirror">Dynamic Mirror</a></li> <li><img alt="" src="../images/down.gif" /> <a href="#reverse-dynamic-mirror">Reverse Dynamic Mirror</a></li> <li><img alt="" src="../images/down.gif" /> <a href="#retrieve-missing-data">Retrieve Missing Data from Intranet</a></li> @@ -434,63 +432,6 @@ </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> <div class="section"> -<h2><a name="cluster" id="cluster">URL-based sharding accross multiple backends</a></h2> - - - - <dl> - <dt>Description:</dt> - - <dd> - <p>A common technique for distributing the burden of - server load or storage space is called "sharding". - When using this method, a front-end server will use the - url to consistently "shard" users or objects to seperate - backend servers.</p> - </dd> - - <dt>Solution:</dt> - - <dd> - <p>A mapping is maintained, from users to target servers, in - external map files. They look like:</p> - -<div class="example"><pre> -user1 physical_host_of_user1 -user2 physical_host_of_user2 -: : -</pre></div> - - <p>We put this into a <code>map.users-to-hosts</code> file. The - aim is to map;</p> - -<div class="example"><pre> -/u/user1/anypath -</pre></div> - - <p>to</p> - -<div class="example"><pre> -http://physical_host_of_user1/u/user/anypath -</pre></div> - - <p>thus every URL path need not be valid on every backend physical - host. The following ruleset does this for us with the help of the map - files assuming that server0 is a default server which will be used if - a user has no entry in the map):</p> - -<div class="example"><pre> -RewriteEngine on - -RewriteMap users-to-hosts txt:/path/to/map.users-to-hosts - -RewriteRule ^/u/<strong>([^/]+)</strong>/?(.*) http://<strong>${users-to-hosts:$1|server0}</strong>/u/$1/$2 -</pre></div> - </dd> - </dl> - - </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> -<div class="section"> <h2><a name="structuredhomedirs" id="structuredhomedirs">Structured Homedirs</a></h2> @@ -523,50 +464,6 @@ </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> <div class="section"> -<h2><a name="browser-dependent-content" id="browser-dependent-content">Browser Dependent Content</a></h2> - - - - <dl> - <dt>Description:</dt> - - <dd> - <p>At least for important top-level pages it is sometimes - necessary to provide the optimum of browser dependent - content, i.e., one has to provide one version for - current browsers, a different version for the Lynx and text-mode - browsers, and another for other browsers.</p> - </dd> - - <dt>Solution:</dt> - - <dd> - <p>We cannot use content negotiation because the browsers do - not provide their type in that form. Instead we have to - act on the HTTP header "User-Agent". The following config - does the following: If the HTTP header "User-Agent" - begins with "Mozilla/3", the page <code>foo.html</code> - is rewritten to <code>foo.NS.html</code> and the - rewriting stops. If the browser is "Lynx" or "Mozilla" of - version 1 or 2, the URL becomes <code>foo.20.html</code>. - All other browsers receive page <code>foo.32.html</code>. - This is done with the following ruleset:</p> - -<div class="example"><pre> -RewriteCond %{HTTP_USER_AGENT} ^<strong>Mozilla/3</strong>.* -RewriteRule ^foo\.html$ foo.<strong>NS</strong>.html [<strong>L</strong>] - -RewriteCond %{HTTP_USER_AGENT} ^<strong>Lynx/</strong>.* [OR] -RewriteCond %{HTTP_USER_AGENT} ^<strong>Mozilla/[12]</strong>.* -RewriteRule ^foo\.html$ foo.<strong>20</strong>.html [<strong>L</strong>] - -RewriteRule ^foo\.html$ foo.<strong>32</strong>.html [<strong>L</strong>] -</pre></div> - </dd> - </dl> - - </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> -<div class="section"> <h2><a name="dynamic-mirror" id="dynamic-mirror">Dynamic Mirror</a></h2> Modified: httpd/httpd/trunk/docs/manual/rewrite/rewrite_guide.xml URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/rewrite/rewrite_guide.xml?rev=832973&r1=832972&r2=832973&view=diff ============================================================================== --- httpd/httpd/trunk/docs/manual/rewrite/rewrite_guide.xml (original) +++ httpd/httpd/trunk/docs/manual/rewrite/rewrite_guide.xml Thu Nov 5 01:55:43 2009 @@ -424,63 +424,6 @@ </section> - <section id="cluster"> - - <title>URL-based sharding accross multiple backends</title> - - <dl> - <dt>Description:</dt> - - <dd> - <p>A common technique for distributing the burden of - server load or storage space is called "sharding". - When using this method, a front-end server will use the - url to consistently "shard" users or objects to seperate - backend servers.</p> - </dd> - - <dt>Solution:</dt> - - <dd> - <p>A mapping is maintained, from users to target servers, in - external map files. They look like:</p> - -<example><pre> -user1 physical_host_of_user1 -user2 physical_host_of_user2 -: : -</pre></example> - - <p>We put this into a <code>map.users-to-hosts</code> file. The - aim is to map;</p> - -<example><pre> -/u/user1/anypath -</pre></example> - - <p>to</p> - -<example><pre> -http://physical_host_of_user1/u/user/anypath -</pre></example> - - <p>thus every URL path need not be valid on every backend physical - host. The following ruleset does this for us with the help of the map - files assuming that server0 is a default server which will be used if - a user has no entry in the map):</p> - -<example><pre> -RewriteEngine on - -RewriteMap users-to-hosts txt:/path/to/map.users-to-hosts - -RewriteRule ^/u/<strong>([^/]+)</strong>/?(.*) http://<strong>${users-to-hosts:$1|server0}</strong>/u/$1/$2 -</pre></example> - </dd> - </dl> - - </section> - <section id="structuredhomedirs"> <title>Structured Homedirs</title> @@ -513,50 +456,6 @@ </section> - <section id="browser-dependent-content"> - - <title>Browser Dependent Content</title> - - <dl> - <dt>Description:</dt> - - <dd> - <p>At least for important top-level pages it is sometimes - necessary to provide the optimum of browser dependent - content, i.e., one has to provide one version for - current browsers, a different version for the Lynx and text-mode - browsers, and another for other browsers.</p> - </dd> - - <dt>Solution:</dt> - - <dd> - <p>We cannot use content negotiation because the browsers do - not provide their type in that form. Instead we have to - act on the HTTP header "User-Agent". The following config - does the following: If the HTTP header "User-Agent" - begins with "Mozilla/3", the page <code>foo.html</code> - is rewritten to <code>foo.NS.html</code> and the - rewriting stops. If the browser is "Lynx" or "Mozilla" of - version 1 or 2, the URL becomes <code>foo.20.html</code>. - All other browsers receive page <code>foo.32.html</code>. - This is done with the following ruleset:</p> - -<example><pre> -RewriteCond %{HTTP_USER_AGENT} ^<strong>Mozilla/3</strong>.* -RewriteRule ^foo\.html$ foo.<strong>NS</strong>.html [<strong>L</strong>] - -RewriteCond %{HTTP_USER_AGENT} ^<strong>Lynx/</strong>.* [OR] -RewriteCond %{HTTP_USER_AGENT} ^<strong>Mozilla/[12]</strong>.* -RewriteRule ^foo\.html$ foo.<strong>20</strong>.html [<strong>L</strong>] - -RewriteRule ^foo\.html$ foo.<strong>32</strong>.html [<strong>L</strong>] -</pre></example> - </dd> - </dl> - - </section> - <section id="dynamic-mirror"> <title>Dynamic Mirror</title>
|