From fd407bc188f5082395c31c5800940f67ba2aae4f Mon Sep 17 00:00:00 2001 From: Rich Bowen Date: Mon, 12 Sep 2011 14:21:41 +0000 Subject: [PATCH] Updates one of the "advanced" recipes and rewrites description. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1169760 13f79535-47bb-0310-9956-ffa450edef68 --- docs/manual/rewrite/access.html.en | 2 +- docs/manual/rewrite/access.xml | 2 +- docs/manual/rewrite/advanced.html.en | 37 ++++++++++++++-------- docs/manual/rewrite/advanced.xml | 44 ++++++++++++++++++-------- docs/manual/rewrite/avoid.html.en | 2 +- docs/manual/rewrite/avoid.xml | 2 +- docs/manual/rewrite/flags.html.en | 2 +- docs/manual/rewrite/flags.xml | 2 +- docs/manual/rewrite/htaccess.html.en | 2 +- docs/manual/rewrite/htaccess.xml | 2 +- docs/manual/rewrite/index.html.en | 2 +- docs/manual/rewrite/index.xml | 2 +- docs/manual/rewrite/intro.html.en | 2 +- docs/manual/rewrite/intro.xml | 2 +- docs/manual/rewrite/proxy.html.en | 2 +- docs/manual/rewrite/proxy.xml | 2 +- docs/manual/rewrite/remapping.html.en | 2 +- docs/manual/rewrite/remapping.xml | 2 +- docs/manual/rewrite/rewritemap.html.en | 2 +- docs/manual/rewrite/rewritemap.xml | 2 +- docs/manual/rewrite/tech.html.en | 2 +- docs/manual/rewrite/tech.xml | 2 +- docs/manual/rewrite/vhosts.html.en | 2 +- docs/manual/rewrite/vhosts.xml | 2 +- 24 files changed, 76 insertions(+), 49 deletions(-) diff --git a/docs/manual/rewrite/access.html.en b/docs/manual/rewrite/access.html.en index ffcc97c92a..702989c02c 100644 --- a/docs/manual/rewrite/access.html.en +++ b/docs/manual/rewrite/access.html.en @@ -39,7 +39,7 @@ configuration.
  • Blocking of Robots
  • Denying Hosts in a Blacklist
  • Referer-based Deflector
  • -

    See also

    +

    See also

    top

    Forbidding Image "Hotlinking"

    diff --git a/docs/manual/rewrite/access.xml b/docs/manual/rewrite/access.xml index 5e2affcbe7..ec6d8909c9 100644 --- a/docs/manual/rewrite/access.xml +++ b/docs/manual/rewrite/access.xml @@ -47,7 +47,7 @@ configuration. Virtual hosts Proxying Using RewriteMap -Advanced techniques and tricks +Advanced techniques When not to use mod_rewrite
    diff --git a/docs/manual/rewrite/advanced.html.en b/docs/manual/rewrite/advanced.html.en index a2dedf4d5b..90f09011d0 100644 --- a/docs/manual/rewrite/advanced.html.en +++ b/docs/manual/rewrite/advanced.html.en @@ -24,7 +24,7 @@

    This document supplements the mod_rewrite reference documentation. It provides -a few advanced techniques and tricks using mod_rewrite.

    +a few advanced techniques using mod_rewrite.

    Note that many of these examples won't work unchanged in your particular server configuration, so it's important that you understand @@ -98,6 +98,9 @@ RewriteRule ^/u/([^/]+)/?(.*) http://${users-to-hos +

    See the RewriteMap + documentation for more discussion of the syntax of this directive.

    +
    top

    On-the-fly Content-Regeneration

    @@ -122,20 +125,22 @@ RewriteRule ^/u/([^/]+)/?(.*) http://${users-to-hos

    # This example is valid in per-directory context only
    -RewriteCond %{REQUEST_FILENAME} !-s
    -RewriteRule ^page\.html$ page.cgi [T=application/x-httpd-cgi,L] +RewriteCond %{REQUEST_URI} !-U
    +RewriteRule ^(.+)\.html$ /regenerate_page.cgi [PT,L]

    -

    Here a request for page.html leads to an - internal run of a corresponding page.cgi if - page.html is missing or has filesize - null. The trick here is that page.cgi is a - CGI script which (additionally to its STDOUT) - writes its output to the file page.html. - Once it has completed, the server sends out - page.html. When the webmaster wants to force - a refresh of the contents, he just removes - page.html (typically from cron).

    +

    The -U operator determines whether the test string + (in this case, REQUEST_URI) is a valid URL. It does + this via a subrequest. In the event that this subrequest fails - + that is, the requested resource doesn't exist - this rule invokes + the CGI program /regenerate_page.cgi, which generates + the requested resource and saves it into the document directory, so + that the next time it is requested, a static copy can be served.

    + +

    In this way, documents that are infrequently updated can be served in + static form. if documents need to be refreshed, they can be deleted + from the document directory, and they will then be regenerated the + next time they are requested.

    @@ -193,6 +198,8 @@ featureful than anything you can cobble together using mod_rewrite.

    + +
    Description:
    @@ -480,6 +487,10 @@ RewriteRule ^/horse/(.*) /pony/$1 [E=rewritten:1] RewriteCond %{ENV:rewritten} =1

    +

    Note that environment variables do not survive an external + redirect. You might consider using the [CO] flag to set a + cookie.

    + diff --git a/docs/manual/rewrite/advanced.xml b/docs/manual/rewrite/advanced.xml index 22da720efc..61870104ef 100644 --- a/docs/manual/rewrite/advanced.xml +++ b/docs/manual/rewrite/advanced.xml @@ -29,7 +29,7 @@

    This document supplements the mod_rewrite reference documentation. It provides -a few advanced techniques and tricks using mod_rewrite.

    +a few advanced techniques using mod_rewrite.

    Note that many of these examples won't work unchanged in your particular server configuration, so it's important that you understand @@ -44,7 +44,7 @@ configuration. Virtual hosts Proxying Using RewriteMap - + When not to use mod_rewrite
    @@ -102,6 +102,9 @@ RewriteRule ^/u/([^/]+)/?(.*) http://${users-to-hos +

    See the RewriteMap + documentation for more discussion of the syntax of this directive.

    +
    @@ -126,20 +129,22 @@ RewriteRule ^/u/([^/]+)/?(.*) http://${users-to-hos # This example is valid in per-directory context only
    -RewriteCond %{REQUEST_FILENAME} !-s
    -RewriteRule ^page\.html$ page.cgi [T=application/x-httpd-cgi,L] +RewriteCond %{REQUEST_URI} !-U
    +RewriteRule ^(.+)\.html$ /regenerate_page.cgi [PT,L]
    -

    Here a request for page.html leads to an - internal run of a corresponding page.cgi if - page.html is missing or has filesize - null. The trick here is that page.cgi is a - CGI script which (additionally to its STDOUT) - writes its output to the file page.html. - Once it has completed, the server sends out - page.html. When the webmaster wants to force - a refresh of the contents, he just removes - page.html (typically from cron).

    +

    The -U operator determines whether the test string + (in this case, REQUEST_URI) is a valid URL. It does + this via a subrequest. In the event that this subrequest fails - + that is, the requested resource doesn't exist - this rule invokes + the CGI program /regenerate_page.cgi, which generates + the requested resource and saves it into the document directory, so + that the next time it is requested, a static copy can be served.

    + +

    In this way, documents that are infrequently updated can be served in + static form. if documents need to be refreshed, they can be deleted + from the document directory, and they will then be regenerated the + next time they are requested.

    @@ -198,6 +203,13 @@ featureful than anything you can cobble together using mod_rewrite.

    Document With Autorefresh + +
    Description:
    @@ -485,6 +497,10 @@ RewriteRule ^/horse/(.*) /pony/$1 [E=rewritten:1] RewriteCond %{ENV:rewritten} =1 +

    Note that environment variables do not survive an external + redirect. You might consider using the [CO] flag to set a + cookie.

    +
    diff --git a/docs/manual/rewrite/avoid.html.en b/docs/manual/rewrite/avoid.html.en index 9ccd427279..6da776e0bf 100644 --- a/docs/manual/rewrite/avoid.html.en +++ b/docs/manual/rewrite/avoid.html.en @@ -52,7 +52,7 @@ files to work with, you may need to resort to
  • Virtual Hosting
  • Simple Proxying
  • Environment Variable Testing
  • -

    See also

    +

    See also

    top

    Simple Redirection

    diff --git a/docs/manual/rewrite/avoid.xml b/docs/manual/rewrite/avoid.xml index ff89a851a4..da6578ec98 100644 --- a/docs/manual/rewrite/avoid.xml +++ b/docs/manual/rewrite/avoid.xml @@ -59,7 +59,7 @@ files to work with, you may need to resort to Virtual hosts Proxying Using RewriteMap -Advanced techniques and tricks +Advanced techniques
    diff --git a/docs/manual/rewrite/flags.html.en b/docs/manual/rewrite/flags.html.en index e0ec73b7f5..e55b9da630 100644 --- a/docs/manual/rewrite/flags.html.en +++ b/docs/manual/rewrite/flags.html.en @@ -48,7 +48,7 @@ providing detailed explanations and examples.

  • R|redirect
  • S|skip
  • T|type
  • -

    See also

    +

    See also

    top

    Introduction

    diff --git a/docs/manual/rewrite/flags.xml b/docs/manual/rewrite/flags.xml index b5438aa1a2..b907ef348e 100644 --- a/docs/manual/rewrite/flags.xml +++ b/docs/manual/rewrite/flags.xml @@ -38,7 +38,7 @@ providing detailed explanations and examples.

    Virtual hosts Proxying Using RewriteMap -Advanced techniques and tricks +Advanced techniques When not to use mod_rewrite
    Introduction diff --git a/docs/manual/rewrite/htaccess.html.en b/docs/manual/rewrite/htaccess.html.en index b45b4f4d99..2c388d408c 100644 --- a/docs/manual/rewrite/htaccess.html.en +++ b/docs/manual/rewrite/htaccess.html.en @@ -28,7 +28,7 @@ the way that the rules change when you use mod_rewrite in .htaccess files, and how to deal with these changes.

    - +

    Available Languages:  en 

    diff --git a/docs/manual/rewrite/htaccess.xml b/docs/manual/rewrite/htaccess.xml index b67dfaaff6..8448746bf8 100644 --- a/docs/manual/rewrite/htaccess.xml +++ b/docs/manual/rewrite/htaccess.xml @@ -40,7 +40,7 @@ and how to deal with these changes.

    Virtual hosts Proxying Using RewriteMap -Advanced techniques and tricks +Advanced techniques When not to use mod_rewrite diff --git a/docs/manual/rewrite/index.html.en b/docs/manual/rewrite/index.html.en index e23a0e1267..d9bc00217f 100644 --- a/docs/manual/rewrite/index.html.en +++ b/docs/manual/rewrite/index.html.en @@ -66,7 +66,7 @@ documentation
  • Dynamic virtual hosts with mod_rewrite
  • Dynamic proxying with mod_rewrite
  • Using RewriteMap
  • -
  • Advanced techniques and tricks
  • +
  • Advanced techniques
  • When NOT to use mod_rewrite
  • RewriteRule Flags
  • Technical details
  • diff --git a/docs/manual/rewrite/index.xml b/docs/manual/rewrite/index.xml index 26177e200b..591dc031fd 100644 --- a/docs/manual/rewrite/index.xml +++ b/docs/manual/rewrite/index.xml @@ -71,7 +71,7 @@ documentation
  • Dynamic virtual hosts with mod_rewrite
  • Dynamic proxying with mod_rewrite
  • Using RewriteMap
  • -
  • Advanced techniques and tricks
  • +
  • Advanced techniques
  • When NOT to use mod_rewrite
  • RewriteRule Flags
  • Technical details
  • diff --git a/docs/manual/rewrite/intro.html.en b/docs/manual/rewrite/intro.html.en index 57ebb590bb..292c97640c 100644 --- a/docs/manual/rewrite/intro.html.en +++ b/docs/manual/rewrite/intro.html.en @@ -36,7 +36,7 @@ but this doc should help the beginner get their feet wet.
  • Rewrite Conditions
  • Rewrite maps
  • .htaccess files
  • -

    See also

    +

    See also

    top

    Introduction

    diff --git a/docs/manual/rewrite/intro.xml b/docs/manual/rewrite/intro.xml index 9f1c17ee3e..f8370b015d 100644 --- a/docs/manual/rewrite/intro.xml +++ b/docs/manual/rewrite/intro.xml @@ -41,7 +41,7 @@ but this doc should help the beginner get their feet wet. Virtual hosts Proxying Using RewriteMap -Advanced techniques and tricks +Advanced techniques When not to use mod_rewrite
    Introduction diff --git a/docs/manual/rewrite/proxy.html.en b/docs/manual/rewrite/proxy.html.en index 888fc91d80..0498992496 100644 --- a/docs/manual/rewrite/proxy.html.en +++ b/docs/manual/rewrite/proxy.html.en @@ -28,7 +28,7 @@ how to use the RewriteRule's [P] flag to proxy content to another server. A number of recipes are provided that describe common scenarios.

    - +
    top

    Proxying Content with mod_rewrite

    diff --git a/docs/manual/rewrite/proxy.xml b/docs/manual/rewrite/proxy.xml index 1020cb5675..d262b68ba3 100644 --- a/docs/manual/rewrite/proxy.xml +++ b/docs/manual/rewrite/proxy.xml @@ -40,7 +40,7 @@ A number of recipes are provided that describe common scenarios.

    Virtual hosts Using RewriteMap -Advanced techniques and tricks +Advanced techniques When not to use mod_rewrite
    diff --git a/docs/manual/rewrite/remapping.html.en b/docs/manual/rewrite/remapping.html.en index c616b65835..2e4bdd782c 100644 --- a/docs/manual/rewrite/remapping.html.en +++ b/docs/manual/rewrite/remapping.html.en @@ -46,7 +46,7 @@ configuration.
  • Canonical URLs
  • Moved DocumentRoot
  • Fallback Resource
  • -

    See also

    +

    See also

    top

    From Old to New (internal)

    diff --git a/docs/manual/rewrite/remapping.xml b/docs/manual/rewrite/remapping.xml index b41655c341..19d98128a2 100644 --- a/docs/manual/rewrite/remapping.xml +++ b/docs/manual/rewrite/remapping.xml @@ -46,7 +46,7 @@ configuration. Virtual hosts Proxying Using RewriteMap -Advanced techniques and tricks +Advanced techniques When not to use mod_rewrite
    diff --git a/docs/manual/rewrite/rewritemap.html.en b/docs/manual/rewrite/rewritemap.html.en index 9df398405b..59922c524a 100644 --- a/docs/manual/rewrite/rewritemap.html.en +++ b/docs/manual/rewrite/rewritemap.html.en @@ -41,7 +41,7 @@ configuration.
  • prg: External Rewriting Program
  • dbd or fastdbd: SQL Query
  • Summary
  • -

    See also

    +

    See also

    top

    Introduction

    diff --git a/docs/manual/rewrite/rewritemap.xml b/docs/manual/rewrite/rewritemap.xml index 0a8d19ce7f..6590baca13 100644 --- a/docs/manual/rewrite/rewritemap.xml +++ b/docs/manual/rewrite/rewritemap.xml @@ -40,7 +40,7 @@ configuration. Controlling access Virtual hosts Proxying - Advanced techniques and tricks + Advanced techniques When not to use mod_rewrite
    diff --git a/docs/manual/rewrite/tech.html.en b/docs/manual/rewrite/tech.html.en index 357c3d1aab..e751ef148f 100644 --- a/docs/manual/rewrite/tech.html.en +++ b/docs/manual/rewrite/tech.html.en @@ -28,7 +28,7 @@ and URL matching.

    +

    See also

    top

    Internal Processing

    diff --git a/docs/manual/rewrite/tech.xml b/docs/manual/rewrite/tech.xml index fe5f563b51..b664943cdf 100644 --- a/docs/manual/rewrite/tech.xml +++ b/docs/manual/rewrite/tech.xml @@ -36,7 +36,7 @@ and URL matching.

    Virtual hosts Proxying Using RewriteMap -Advanced techniques and tricks +Advanced techniques When not to use mod_rewrite
    Internal Processing diff --git a/docs/manual/rewrite/vhosts.html.en b/docs/manual/rewrite/vhosts.html.en index 4cfa70b3c2..7fbad4a55a 100644 --- a/docs/manual/rewrite/vhosts.html.en +++ b/docs/manual/rewrite/vhosts.html.en @@ -37,7 +37,7 @@ mod_rewrite document.
  • Dynamic Virtual Hosts Using mod_rewrite
  • Using a Separate Virtual Host Configuration File
  • -

    See also

    +

    See also

    top

    Virtual Hosts For Arbitrary Hostnames

    diff --git a/docs/manual/rewrite/vhosts.xml b/docs/manual/rewrite/vhosts.xml index 76e69a0832..f52f55c555 100644 --- a/docs/manual/rewrite/vhosts.xml +++ b/docs/manual/rewrite/vhosts.xml @@ -46,7 +46,7 @@ mod_rewrite document. Proxying RewriteMap -Advanced techniques and tricks +Advanced techniques When not to use mod_rewrite
    -- 2.40.0