From: Joshua Slive Date: Fri, 30 Jun 2006 19:04:50 +0000 (+0000) Subject: Make it clear what is meant by per-directory rewrites X-Git-Tag: 2.3.0~2296 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b37cb49a96a4517cbd5026ef0fd1f2b94920b177;p=apache Make it clear what is meant by per-directory rewrites and specify the rewrites in is unsupported. (The same is probably true for , but I'd have to think about that a little more.) PR: 39843 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@418360 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/docs/manual/mod/mod_rewrite.xml b/docs/manual/mod/mod_rewrite.xml index 61d05e2829..672630e9e2 100644 --- a/docs/manual/mod/mod_rewrite.xml +++ b/docs/manual/mod/mod_rewrite.xml @@ -1423,34 +1423,42 @@ cannot use $N in the substitution string! -Note: Enabling rewrites in per-directory context - To enable the rewrite engine - for per-directory configuration files you need to set - ``RewriteEngine On'' in these files - and ``Options - FollowSymLinks'' must be enabled. If your - administrator has disabled override of - FollowSymLinks for a user's directory, then - you cannot use the rewrite engine. This restriction is - required for security reasons. - - -Note: Pattern matching in per-directory context - Never forget that Pattern is -applied to a complete URL in per-server configuration -files. However, in per-directory configuration files, the +Per-directory Rewrites + +

The rewrite engine may be used in .htaccess files. To enable the +rewrite engine for these files you need to set +"RewriteEngine On" and +"Options FollowSymLinks" must be enabled. If your +administrator has disabled override of FollowSymLinks for +a user's directory, then you cannot use the rewrite engine. This +restriction is required for security reasons.

+ +

When using the rewrite engine in .htaccess files the per-directory prefix (which always is the same for a specific directory) is automatically removed for the pattern matching and automatically added after the substitution has been -done. This feature is essential for many sorts of rewriting - -without this, you would always have to match the parent -directory, which is not always possible. - -

There is one exception: If a substitution string - starts with ``http://'', then the directory - prefix will not be added ,and an - external redirect (or proxy throughput, if using flag - P) is forced!

+done. This feature is essential for many sorts of rewriting; without +this, you would always have to match the parent directory, which is +not always possible. There is one exception: If a substitution string +starts with http://, then the directory prefix will +not be added, and an external redirect (or proxy +throughput, if using flag P) is forced. See the +RewriteBase directive for +more information.

+ +

The rewrite engine may also be used in Directory sections with the same +prefix-matching rules as would be applied to .htaccess +files. It is usually simpler, however, to avoid the prefix substitution +complication by putting the rewrite rules in the main server or +virtual host context, rather than in a Directory section.

+ +

Although rewrite rules are syntactically permitted in Location sections, this +should never be necessary and is unsupported.

+
Note: Substitution of Absolute URLs