]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Not sure this is actually a useful recipe, but it belongs in the access
authorRich Bowen <rbowen@apache.org>
Mon, 16 Nov 2009 11:17:54 +0000 (11:17 +0000)
committerRich Bowen <rbowen@apache.org>
Mon, 16 Nov 2009 11:17:54 +0000 (11:17 +0000)
file.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@880707 13f79535-47bb-0310-9956-ffa450edef68

docs/manual/rewrite/access.html.en
docs/manual/rewrite/access.xml
docs/manual/rewrite/rewrite_guide.html.en
docs/manual/rewrite/rewrite_guide.xml

index 12ee3d436e6b38467dc7cff0631029d3c18f9c3c..6f0dc6725df5abf08f79f75df03909a756f84c5d 100644 (file)
@@ -38,6 +38,7 @@ configuration.</div>
 <div id="quickview"><ul id="toc"><li><img alt="" src="../images/down.gif" /> <a href="#blocked-inline-images">Forbidding Image "Hotlinking"</a></li>
 <li><img alt="" src="../images/down.gif" /> <a href="#blocking-of-robots">Blocking of Robots</a></li>
 <li><img alt="" src="../images/down.gif" /> <a href="#host-deny">Denying Hosts in a Blacklist</a></li>
+<li><img alt="" src="../images/down.gif" /> <a href="#referer-deflector">Referer-based Deflector</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><li><a href="remapping.html">Redirection and remapping</a></li><li><a href="advanced.html">Advanced techniques and tricks</a></li><li><a href="avoid.html">When not to use mod_rewrite</a></li></ul></div>
 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
 <div class="section">
@@ -244,6 +245,55 @@ bsdti1.sdm.de  -
     </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="referer-deflector" id="referer-deflector">Referer-based Deflector</a></h2>
+
+  
+
+  <dl>
+    <dt>Description:</dt>
+
+    <dd>
+      <p>Redirect requests based on the Referer from which the request
+      came, with different targets per Referer.</p>
+    </dd>
+
+    <dt>Solution:</dt>
+
+    <dd>
+  <p>The following ruleset uses a map file to associate each Referer
+  with a redirection target.</p>
+
+<div class="example"><pre>
+RewriteMap  deflector txt:/path/to/deflector.map
+
+RewriteCond %{HTTP_REFERER} !=""
+RewriteCond ${deflector:%{HTTP_REFERER}} =-
+RewriteRule ^ %{HTTP_REFERER} [R,L]
+
+RewriteCond %{HTTP_REFERER} !=""
+RewriteCond ${deflector:%{HTTP_REFERER}|NOT-FOUND} !=NOT-FOUND
+RewriteRule ^.* ${deflector:%{HTTP_REFERER}} [R,L]
+</pre></div>
+
+      <p>The map file lists redirection targets for each referer, or, if
+      we just wish to redirect back to where they came from, a "-" is
+      placed in the map:</p>
+
+<div class="example"><pre>
+##
+##  deflector.map
+##
+
+http://www.badguys.com/bad/index.html    -
+http://www.badguys.com/bad/index2.html   -
+http://www.badguys.com/bad/index3.html   http://somewhere.com/
+</pre></div>
+
+    </dd>
+  </dl>
+
 </div></div>
 <div class="bottomlang">
 <p><span>Available Languages: </span><a href="../en/rewrite/access.html" title="English">&nbsp;en&nbsp;</a></p>
index 4b23440e98b7b8db88112c2aff25b6ab482389d1..7a87eb5387d3760e4980834584edb2b11f13e7a3 100644 (file)
@@ -252,4 +252,53 @@ bsdti1.sdm.de  -
 
 </section>
 
+<section id="referer-deflector">
+
+  <title>Referer-based Deflector</title>
+
+  <dl>
+    <dt>Description:</dt>
+
+    <dd>
+      <p>Redirect requests based on the Referer from which the request
+      came, with different targets per Referer.</p>
+    </dd>
+
+    <dt>Solution:</dt>
+
+    <dd>
+  <p>The following ruleset uses a map file to associate each Referer
+  with a redirection target.</p>
+
+<example><pre>
+RewriteMap  deflector txt:/path/to/deflector.map
+
+RewriteCond %{HTTP_REFERER} !=""
+RewriteCond ${deflector:%{HTTP_REFERER}} =-
+RewriteRule ^ %{HTTP_REFERER} [R,L]
+
+RewriteCond %{HTTP_REFERER} !=""
+RewriteCond ${deflector:%{HTTP_REFERER}|NOT-FOUND} !=NOT-FOUND
+RewriteRule ^.* ${deflector:%{HTTP_REFERER}} [R,L]
+</pre></example>
+
+      <p>The map file lists redirection targets for each referer, or, if
+      we just wish to redirect back to where they came from, a "-" is
+      placed in the map:</p>
+
+<example><pre>
+##
+##  deflector.map
+##
+
+http://www.badguys.com/bad/index.html    -
+http://www.badguys.com/bad/index2.html   -
+http://www.badguys.com/bad/index3.html   http://somewhere.com/
+</pre></example>
+
+    </dd>
+  </dl>
+
+</section>
+
 </manualpage> 
index 86d934dc359f44064a89c2ab05f2c7232ddce5af..73095f0a42d1e2f5fed10992ee009bbe1da4402a 100644 (file)
@@ -52,7 +52,6 @@
 <li><img alt="" src="../images/down.gif" /> <a href="#retrieve-missing-data">Retrieve Missing Data from Intranet</a></li>
 <li><img alt="" src="../images/down.gif" /> <a href="#new-mime-type">New MIME-type, New Service</a></li>
 <li><img alt="" src="../images/down.gif" /> <a href="#mass-virtual-hosting">Mass Virtual Hosting</a></li>
-<li><img alt="" src="../images/down.gif" /> <a href="#referer-deflector">Referer-based Deflector</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><li><a href="rewrite_guide_advanced.html">Advanced Rewrite Guide - advanced 
@@ -591,58 +590,6 @@ RewriteRule   ^/(.*)$   %1/$1  [E=VHOST:${lowercase:%{HTTP_HOST}}]
         </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="referer-deflector" id="referer-deflector">Referer-based Deflector</a></h2>
-
-      
-
-      <dl>
-        <dt>Description:</dt>
-
-        <dd>
-          <p>How can we program a flexible URL Deflector which acts
-          on the "Referer" HTTP header and can be configured with as
-          many referring pages as we like?</p>
-        </dd>
-
-        <dt>Solution:</dt>
-
-        <dd>
-          <p>Use the following really tricky ruleset...</p>
-
-<div class="example"><pre>
-RewriteMap  deflector txt:/path/to/deflector.map
-
-RewriteCond %{HTTP_REFERER} !=""
-RewriteCond ${deflector:%{HTTP_REFERER}} ^-$
-RewriteRule ^.* %{HTTP_REFERER} [R,L]
-
-RewriteCond %{HTTP_REFERER} !=""
-RewriteCond ${deflector:%{HTTP_REFERER}|NOT-FOUND} !=NOT-FOUND
-RewriteRule ^.* ${deflector:%{HTTP_REFERER}} [R,L]
-</pre></div>
-
-          <p>... in conjunction with a corresponding rewrite
-          map:</p>
-
-<div class="example"><pre>
-##
-##  deflector.map
-##
-
-http://www.badguys.com/bad/index.html    -
-http://www.badguys.com/bad/index2.html   -
-http://www.badguys.com/bad/index3.html   http://somewhere.com/
-</pre></div>
-
-          <p>This automatically redirects the request back to the
-          referring page (when "<code>-</code>" is used as the value
-          in the map) or to a specific URL (when an URL is specified
-          in the map as the second argument).</p>
-        </dd>
-      </dl>
-
     </div></div>
 <div class="bottomlang">
 <p><span>Available Languages: </span><a href="../en/rewrite/rewrite_guide.html" title="English">&nbsp;en&nbsp;</a> |
index c8ec04a2d95c3ec1906bc5bd1596b2f8b80d6311..3fb19eabec55626af120c0bd050d387b6ed91593 100644 (file)
@@ -591,58 +591,6 @@ RewriteRule   ^/(.*)$   %1/$1  [E=VHOST:${lowercase:%{HTTP_HOST}}]
 
     </section>
 
-    <section id="referer-deflector">
-
-      <title>Referer-based Deflector</title>
-
-      <dl>
-        <dt>Description:</dt>
-
-        <dd>
-          <p>How can we program a flexible URL Deflector which acts
-          on the "Referer" HTTP header and can be configured with as
-          many referring pages as we like?</p>
-        </dd>
-
-        <dt>Solution:</dt>
-
-        <dd>
-          <p>Use the following really tricky ruleset...</p>
-
-<example><pre>
-RewriteMap  deflector txt:/path/to/deflector.map
-
-RewriteCond %{HTTP_REFERER} !=""
-RewriteCond ${deflector:%{HTTP_REFERER}} ^-$
-RewriteRule ^.* %{HTTP_REFERER} [R,L]
-
-RewriteCond %{HTTP_REFERER} !=""
-RewriteCond ${deflector:%{HTTP_REFERER}|NOT-FOUND} !=NOT-FOUND
-RewriteRule ^.* ${deflector:%{HTTP_REFERER}} [R,L]
-</pre></example>
-
-          <p>... in conjunction with a corresponding rewrite
-          map:</p>
-
-<example><pre>
-##
-##  deflector.map
-##
-
-http://www.badguys.com/bad/index.html    -
-http://www.badguys.com/bad/index2.html   -
-http://www.badguys.com/bad/index3.html   http://somewhere.com/
-</pre></example>
-
-          <p>This automatically redirects the request back to the
-          referring page (when "<code>-</code>" is used as the value
-          in the map) or to a specific URL (when an URL is specified
-          in the map as the second argument).</p>
-        </dd>
-      </dl>
-
-    </section>
-
 
 </manualpage>