From fd8ad0059b289ae93531562f6f5f2ef9121e2227 Mon Sep 17 00:00:00 2001 From: Noirin Plunkett Date: Mon, 2 Nov 2009 22:05:01 +0000 Subject: [PATCH] Ripping out the stuff that isn't really module reference, and translating the introduction to English git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@832130 13f79535-47bb-0310-9956-ffa450edef68 --- docs/manual/mod/mod_rewrite.html.en | 110 +++++----------------------- docs/manual/mod/mod_rewrite.xml | 104 +++++--------------------- 2 files changed, 35 insertions(+), 179 deletions(-) diff --git a/docs/manual/mod/mod_rewrite.html.en b/docs/manual/mod/mod_rewrite.html.en index 6543c38134..991fd295bf 100644 --- a/docs/manual/mod/mod_rewrite.html.en +++ b/docs/manual/mod/mod_rewrite.html.en @@ -32,24 +32,22 @@ URLs on the fly Compatibility:Available in Apache 1.3 and later

Summary

-

This module uses a rule-based rewriting engine (based on a - regular-expression parser) to rewrite requested URLs on the - fly. It supports an unlimited number of rules and an - unlimited number of attached rule conditions for each rule, to - provide a really flexible and powerful URL manipulation - mechanism. The URL manipulations can depend on various tests, - of server variables, environment variables, HTTP - headers, or time stamps. Even external database lookups in - various formats can be used to achieve highly granular URL - matching.

- -

This module operates on the full URLs (including the - path-info part) both in per-server context - (httpd.conf) and per-directory context - (.htaccess) and can generate query-string - parts on result. The rewritten result can lead to internal - sub-processing, external request redirection or even to an - internal proxy throughput.

+

The mod_rewrite module uses a rule-based rewriting + engine, based on a regular-expression parser, to rewrite requested URLs on + the fly. By default, mod_rewrite maps a URL to a filesystem + path. However, it can also be used to redirect one URL to another URL, or + to invoke an internal proxy fetch.

+

mod_rewrite provides a flexible and powerful way to + manipulate URLs using an unlimited number of rules. Each rule can have an + unlimited number of attached rule conditions, to allow you to rewrite URL + based on server variables, environment variables, HTTP headers, or time + stamps.

+

mod_rewrite operates on the full URL path, including the + path-info section. A rewrite rule can be invoked in + httpd.conf or in .htaccess. The path generated + by a rewrite rule can include a query string, or can lead to internal + sub-processing, external request redirection, or internal proxy + throughput.

Further details, discussion, and examples, are provided in the detailed mod_rewrite documentation.

@@ -66,80 +64,8 @@ URLs on the fly
  • RewriteOptions
  • RewriteRule
  • -

    Topics

    -

    See also

    - -
    top
    -
    -

    Quoting Special Characters

    - -

    As of Apache 1.3.20, special characters in - TestString and Substitution strings can be - escaped (that is, treated as normal characters without their - usual special meaning) by prefixing them with a slash ('\') - character. In other words, you can include an actual - dollar-sign character in a Substitution string by - using '\$'; this keeps mod_rewrite from trying - to treat it as a backreference.

    -
    top
    -
    -

    Environment Variables

    - -

    This module keeps track of two additional (non-standard) - CGI/SSI environment variables named SCRIPT_URL - and SCRIPT_URI. These contain the - logical Web-view to the current resource, while the - standard CGI/SSI variables SCRIPT_NAME and - SCRIPT_FILENAME contain the physical - System-view.

    - -

    Notice: These variables hold the URI/URL as they were - initially requested, that is, before any - rewriting. This is important to note because the rewriting process is - primarily used to rewrite logical URLs to physical - pathnames.
    - These variables are set in per-server context, which means - that they are available in per-directory context only, if - RewriteEngine is set to on in - per-server context.

    - -

    Example

    -SCRIPT_NAME=/sw/lib/w3s/tree/global/u/rse/.www/index.html
    -SCRIPT_FILENAME=/u/rse/.www/index.html
    -SCRIPT_URL=/u/rse/
    -SCRIPT_URI=http://en1.engelschall.com/u/rse/
    -
    - -
    top
    -
    -

    Rewriting in Virtual Hosts

    - -

    By default, mod_rewrite configuration - settings from the main server context are not inherited by - virtual hosts. To make the main server settings apply to virtual - hosts, you must place the following directives in each <VirtualHost> section:

    - -

    - RewriteEngine On
    - RewriteOptions Inherit -

    -
    top
    -
    -

    Practical Solutions

    - -

    For numerous examples of common, and not-so-common, uses for - mod_rewrite, see the Rewrite - Guide, and the Advanced Rewrite - Guide documents.

    -
    +
    top

    RewriteBase Directive

    @@ -1473,7 +1399,7 @@ cannot use $N in the substitution string! Alias /def /ghi

    If you omit the PT flag, - mod_rewrite will rewrite + mod_rewrite will rewrite uri=/abc/... to filename=/def/... as a full API-compliant URI-to-filename translator should do. Then diff --git a/docs/manual/mod/mod_rewrite.xml b/docs/manual/mod/mod_rewrite.xml index ac8b1e907b..081d9faf69 100644 --- a/docs/manual/mod/mod_rewrite.xml +++ b/docs/manual/mod/mod_rewrite.xml @@ -33,97 +33,27 @@ URLs on the flyAvailable in Apache 1.3 and later -

    This module uses a rule-based rewriting engine (based on a - regular-expression parser) to rewrite requested URLs on the - fly. It supports an unlimited number of rules and an - unlimited number of attached rule conditions for each rule, to - provide a really flexible and powerful URL manipulation - mechanism. The URL manipulations can depend on various tests, - of server variables, environment variables, HTTP - headers, or time stamps. Even external database lookups in - various formats can be used to achieve highly granular URL - matching.

    - -

    This module operates on the full URLs (including the - path-info part) both in per-server context - (httpd.conf) and per-directory context - (.htaccess) and can generate query-string - parts on result. The rewritten result can lead to internal - sub-processing, external request redirection or even to an - internal proxy throughput.

    +

    The mod_rewrite module uses a rule-based rewriting + engine, based on a regular-expression parser, to rewrite requested URLs on + the fly. By default, mod_rewrite maps a URL to a filesystem + path. However, it can also be used to redirect one URL to another URL, or + to invoke an internal proxy fetch.

    +

    mod_rewrite provides a flexible and powerful way to + manipulate URLs using an unlimited number of rules. Each rule can have an + unlimited number of attached rule conditions, to allow you to rewrite URL + based on server variables, environment variables, HTTP headers, or time + stamps.

    +

    mod_rewrite operates on the full URL path, including the + path-info section. A rewrite rule can be invoked in + httpd.conf or in .htaccess. The path generated + by a rewrite rule can include a query string, or can lead to internal + sub-processing, external request redirection, or internal proxy + throughput.

    Further details, discussion, and examples, are provided in the detailed mod_rewrite documentation.

    -Rewrite Flags - -
    Quoting Special Characters - -

    As of Apache 1.3.20, special characters in - TestString and Substitution strings can be - escaped (that is, treated as normal characters without their - usual special meaning) by prefixing them with a slash ('\') - character. In other words, you can include an actual - dollar-sign character in a Substitution string by - using '\$'; this keeps mod_rewrite from trying - to treat it as a backreference.

    -
    - -
    Environment Variables - -

    This module keeps track of two additional (non-standard) - CGI/SSI environment variables named SCRIPT_URL - and SCRIPT_URI. These contain the - logical Web-view to the current resource, while the - standard CGI/SSI variables SCRIPT_NAME and - SCRIPT_FILENAME contain the physical - System-view.

    - -

    Notice: These variables hold the URI/URL as they were - initially requested, that is, before any - rewriting. This is important to note because the rewriting process is - primarily used to rewrite logical URLs to physical - pathnames.
    - These variables are set in per-server context, which means - that they are available in per-directory context only, if - RewriteEngine is set to on in - per-server context.

    - -Example -
    -SCRIPT_NAME=/sw/lib/w3s/tree/global/u/rse/.www/index.html
    -SCRIPT_FILENAME=/u/rse/.www/index.html
    -SCRIPT_URL=/u/rse/
    -SCRIPT_URI=http://en1.engelschall.com/u/rse/
    -
    -
    - -
    - -
    Rewriting in Virtual Hosts - -

    By default, mod_rewrite configuration - settings from the main server context are not inherited by - virtual hosts. To make the main server settings apply to virtual - hosts, you must place the following directives in each VirtualHost section:

    - - - RewriteEngine On
    - RewriteOptions Inherit -
    -
    - -
    Practical Solutions - -

    For numerous examples of common, and not-so-common, uses for - mod_rewrite, see the Rewrite - Guide, and the Advanced Rewrite - Guide documents.

    - -
    RewriteEngine @@ -1489,7 +1419,7 @@ cannot use $N in the substitution string! Alias /def /ghi If you omit the PT flag, - mod_rewrite will rewrite + mod_rewrite will rewrite uri=/abc/... to filename=/def/... as a full API-compliant URI-to-filename translator should do. Then -- 2.40.0