From e0d3b0f2c895f1e1a65f42335dbd6a7e737ace24 Mon Sep 17 00:00:00 2001 From: Christophe Jaillet Date: Fri, 1 Apr 2016 20:24:08 +0000 Subject: [PATCH] Fix typo (extra sapce) in example spoted by Juan Antonio Rua Soto in online doc. Add a few more links to modules and directives (more could be done) (r1737433 in trunk) + Synch with trunk git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1737438 13f79535-47bb-0310-9956-ffa450edef68 --- docs/manual/rewrite/avoid.xml | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/docs/manual/rewrite/avoid.xml b/docs/manual/rewrite/avoid.xml index a0c2eb1a91..df7557973c 100644 --- a/docs/manual/rewrite/avoid.xml +++ b/docs/manual/rewrite/avoid.xml @@ -29,14 +29,14 @@

This document supplements the mod_rewrite reference documentation. It describes -perhaps one of the most important concepts about mod_rewrite - namely, +perhaps one of the most important concepts about mod_rewrite - namely, when to avoid using it.

-

mod_rewrite should be considered a last resort, when other +

mod_rewrite should be considered a last resort, when other alternatives are found wanting. Using it when there are simpler alternatives leads to configurations which are confusing, fragile, and hard to maintain. Understanding what other alternatives are available is -a very important step towards mod_rewrite mastery.

+a very important step towards mod_rewrite mastery.

Note that many of these examples won't work unchanged in your particular server configuration, so it's important that you understand @@ -90,7 +90,9 @@ and /one/three/four.html.

To redirect URLs under /one to http://one.example.com, do the following:

-Redirect /one/ http://one.example.com/ + +Redirect "/one/" "http://one.example.com/" +

To redirect one hostname to another, for example example.com to www.example.com, see the @@ -104,12 +106,12 @@ following:

<VirtualHost *:80> ServerName www.example.com Redirect "/" "https://www.example.com/" -</VirtualHost > +</VirtualHost> <VirtualHost *:443> ServerName www.example.com # ... SSL configuration goes here -</VirtualHost > +</VirtualHost>

The use of RewriteRule to perform this task may be @@ -130,16 +132,18 @@ task in a .htaccess file instead.

The Alias directive provides mapping from a URI to a directory - usually a directory outside of your DocumentRoot. Although it -is possible to perform this mapping with mod_rewrite, -Alias is the preferred method, for reasons of simplicity -and performance.

+is possible to perform this mapping with mod_rewrite, +Alias is the preferred method, for +reasons of simplicity and performance.

Using Alias -Alias "/cats" "/var/www/virtualhosts/felines/htdocs" + +Alias "/cats" "/var/www/virtualhosts/felines/htdocs" +

-The use of mod_rewrite to perform this mapping may be +The use of mod_rewrite to perform this mapping may be appropriate when you do not have access to the server configuration files. Alias may only be used in server or virtualhost context, and not in a .htaccess file. @@ -153,7 +157,8 @@ server.

Virtual Hosting

Although it is possible to handle virtual hosts with mod_rewrite, it is seldom the right way. Creating individual -<VirtualHost> blocks is almost always the right way to go. In the +VirtualHost blocks is +almost always the right way to go. In the event that you have an enormous number of virtual hosts, consider using mod_vhost_alias to create these hosts automatically.

@@ -173,7 +178,7 @@ seems like the right approach.

Simple Proxying -

RewriteRule provides the RewriteRule provides the [P] flag to pass rewritten URIs through mod_proxy.

@@ -233,7 +238,8 @@ header, response header, or environment variable, replacing

See especially the expression evaluation documentation for a overview of what types of expressions you can -use in <If> sections, and in certain other directives.

+use in If sections, +and in certain other directives.

-- 2.40.0