Return-Path: Delivered-To: apmail-httpd-cvs-archive@www.apache.org Received: (qmail 40284 invoked from network); 1 Aug 2007 19:04:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 1 Aug 2007 19:04:50 -0000 Received: (qmail 84305 invoked by uid 500); 1 Aug 2007 19:04:50 -0000 Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 84112 invoked by uid 500); 1 Aug 2007 19:04:49 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 84101 invoked by uid 99); 1 Aug 2007 19:04:49 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Aug 2007 12:04:49 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Aug 2007 19:04:23 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 84D471A981A; Wed, 1 Aug 2007 12:04:24 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r561918 - in /httpd/httpd/trunk/docs/manual/mod: mod_rewrite.html.en mod_rewrite.xml Date: Wed, 01 Aug 2007 19:04:23 -0000 To: cvs@httpd.apache.org From: slive@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070801190424.84D471A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: slive Date: Wed Aug 1 12:04:21 2007 New Revision: 561918 URL: http://svn.apache.org/viewvc?view=rev&rev=561918 Log: Change the flag list to a
instead of
    . Seems much more readable to me. Modified: httpd/httpd/trunk/docs/manual/mod/mod_rewrite.html.en httpd/httpd/trunk/docs/manual/mod/mod_rewrite.xml Modified: httpd/httpd/trunk/docs/manual/mod/mod_rewrite.html.en URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/mod/mod_rewrite.html.en?view=diff&rev=561918&r1=561917&r2=561918 ============================================================================== --- httpd/httpd/trunk/docs/manual/mod/mod_rewrite.html.en (original) +++ httpd/httpd/trunk/docs/manual/mod/mod_rewrite.html.en Wed Aug 1 12:04:21 2007 @@ -1251,9 +1251,9 @@ directive. Flags is a comma-separated list, surround by square brackets, of any of the following flags:

    -
      -
    • 'chain|C' - (chained with next rule)
      +
      +
      'chain|C' + (chained with next rule)
      This flag chains the current rule with the next rule (which itself can be chained with the following rule, and so on). This has the following effect: if a rule @@ -1263,21 +1263,21 @@ rules are skipped. For instance, it can be used to remove the ``.www'' part, inside a per-directory rule set, when you let an external redirect happen (where the - ``.www'' part should not occur!).
    • + ``.www'' part should not occur!). -
    • - 'cookie|CO=NAME:VAL:domain[:lifetime[:path]]' - (set cookie)
      +
      + 'cookie|CO=NAME:VAL:domain[:lifetime[:path]]' + (set cookie)
      This sets a cookie in the client's browser. The cookie's name is specified by NAME and the value is VAL. The domain field is the domain of the cookie, such as '.apache.org', the optional lifetime is the lifetime of the cookie in minutes, and the optional - path is the path of the cookie
    • + path is the path of the cookie -
    • - 'env|E=VAR:VAL' - (set environment variable)
      +
      + 'env|E=VAR:VAL' + (set environment variable)
      This forces an environment variable named VAR to be set to the value VAL, where VAL can contain regexp backreferences ($N and @@ -1288,35 +1288,35 @@ var="VAR"-->) or CGI ($ENV{'VAR'}). You can also dereference the variable in a later RewriteCond pattern, using %{ENV:VAR}. Use this to strip - information from URLs, while maintaining a record of that information.
    • + information from URLs, while maintaining a record of that information. -
    • 'forbidden|F' (force URL - to be forbidden)
      +
      'forbidden|F' (force URL + to be forbidden)
      This forces the current URL to be forbidden - it immediately sends back a HTTP response of 403 (FORBIDDEN). Use this flag in conjunction with appropriate RewriteConds to conditionally block some - URLs.
    • + URLs. -
    • 'gone|G' (force URL to be - gone)
      +
      'gone|G' (force URL to be + gone)
      This forces the current URL to be gone - it immediately sends back a HTTP response of 410 (GONE). Use - this flag to mark pages which no longer exist as gone.
    • + this flag to mark pages which no longer exist as gone. -
    • - 'handler|H=Content-handler' - (force Content handler)
      +
      + 'handler|H=Content-handler' + (force Content handler)
      Force the Content-handler of the target file to be Content-handler. For instance, this can be used to simulate the mod_alias directive ScriptAlias, which internally forces all files inside the mapped directory to have a handler of - ``cgi-script''.
    • + ``cgi-script''. -
    • 'last|L' - (last rule)
      Stop the rewriting process +
      'last|L' + (last rule)
      Stop the rewriting process here and don't apply any more rewrite rules. This corresponds to the Perl last command or the break command in C. Use this flag to prevent the @@ -1326,31 +1326,31 @@ redirect (which frequently occurs when rewriting in a per-directory context), this will reinject the request and will cause processing to be repeated starting from the first - RewriteRule.
    • + RewriteRule. -
    • 'next|N' - (next round)
      +
      'next|N' + (next round)
      Re-run the rewriting process (starting again with the first rewriting rule). This time, the URL to match is no longer the original URL, but rather the URL returned by the last rewriting rule. This corresponds to the Perl next command or the continue command in C. Use this flag to restart the rewriting process - - to immediately go to the top of the loop.
      + to immediately go to the top of the loop. Be careful not to create an infinite - loop!
    • + loop! -
    • 'nocase|NC' - (no case)
      +
      'nocase|NC' + (no case)
      This makes the Pattern case-insensitive, ignoring difference between 'A-Z' and 'a-z' when Pattern is matched against the current - URL.
    • + URL. -
    • - 'noescape|NE' - (no URI escaping of - output)
      +
      + 'noescape|NE' + (no URI escaping of + output)
      This flag prevents mod_rewrite from applying the usual URI escaping rules to the result of a rewrite. Ordinarily, special characters (such as '%', '$', ';', and so on) @@ -1363,13 +1363,13 @@

      which would turn '/foo/zed' into a safe request for '/bar?arg=P1=zed'. -
    • + -
    • - 'nosubreq|NS' - (not for internal - sub-requests)
      - This flag forces the rewriting engine to skip a +
      + 'nosubreq|NS' + (not for internal + sub-requests)
      +

      This flag forces the rewriting engine to skip a rewriting rule if the current request is an internal sub-request. For instance, sub-requests occur internally in Apache when mod_include tries to find out @@ -1377,17 +1377,17 @@ (index.xxx files). On sub-requests it is not always useful, and can even cause errors, if the complete set of rules are applied. Use this flag to - exclude some rules.
      - To decide whether or not to use this rule: if you + exclude some rules.

      +

      To decide whether or not to use this rule: if you prefix URLs with CGI-scripts, to force them to be processed by the CGI-script, it's likely that you will run into problems (or significant overhead) on - sub-requests. In these cases, use this flag. -

    • + sub-requests. In these cases, use this flag.

      + -
    • - 'proxy|P' (force - proxy)
      +
      + 'proxy|P' (force + proxy)
      This flag forces the substitution part to be internally sent as a proxy request and immediately (rewrite processing stops here) put through the proxy module. You must make @@ -1402,12 +1402,12 @@

      Note: mod_proxy must be enabled in order to use this flag.

      -
    • + -
    • - 'passthrough|PT' - (pass through to next - handler)
      +
      + 'passthrough|PT' + (pass through to next + handler)
      This flag forces the rewrite engine to set the uri field of the internal request_rec structure to the value of the @@ -1442,59 +1442,58 @@

      The PT flag implies the L flag: rewriting will be stopped in order to pass the request to the next phase of processing.

      -
    • + -
    • 'qsappend|QSA' - (query string - append)
      +
      'qsappend|QSA' + (query string + append)
      This flag forces the rewrite engine to append a query string part of the substitution string to the existing string, instead of replacing it. Use this when you want to add more - data to the query string via a rewrite rule.
    • + data to the query string via a rewrite rule. -
    • 'redirect|R - [=code]' (force redirect)
      -

      Prefix Substitution with +

      'redirect|R + [=code]' (force redirect)
      +

      Prefix Substitution with http://thishost[:thisport]/ (which makes the new URL a URI) to force a external redirection. If no code is given, a HTTP response of 302 (MOVED - TEMPORARILY) will be returned. If you want to use other response - codes, simply specify the appropriate number - or use one of the following symbolic names: - temp (default), permanent, - seeother. Use this for rules to - canonicalize the URL and return it to the client - to - translate ``/~'' into - ``/u/'', or to always append a slash to - /u/user, etc.
      - Note: When you use this flag, make - sure that the substitution field is a valid URL! Otherwise, - you will be redirecting to an invalid location. Remember - that this flag on its own will only prepend - http://thishost[:thisport]/ to the URL, and rewriting - will continue. Usually, you will want to stop rewriting at this point, - and redirect immediately. To stop rewriting, you should add - the 'L' flag.

      + TEMPORARILY) will be returned. If you want to use other + response codes, simply specify the appropriate number or use + one of the following symbolic names: temp + (default), permanent, + seeother. Use this for rules to canonicalize + the URL and return it to the client - to translate + ``/~'' into ``/u/'', or to always + append a slash to /u/user, etc.
      + Note: When you use this flag, make sure + that the substitution field is a valid URL! Otherwise, you + will be redirecting to an invalid location. Remember that + this flag on its own will only prepend + http://thishost[:thisport]/ to the URL, and + rewriting will continue. Usually, you will want to stop + rewriting at this point, and redirect immediately. To stop + rewriting, you should add the 'L' flag.

      While this is typically used for redirects, any valid status code can be given here. If the status code is outside the redirect range (300-399), then the Substitution string is dropped and rewriting is stopped as if the L flag was used.

      -
    • + -
    • 'skip|S=num' - (skip next rule(s))
      +
      'skip|S=num' + (skip next rule(s))
      This flag forces the rewriting engine to skip the next num rules in sequence, if the current rule matches. Use this to make pseudo if-then-else constructs: The last rule of the then-clause becomes skip=N, where N is the number of rules in the else-clause. (This is not the same as the - 'chain|C' flag!)
    • + 'chain|C' flag!) -
    • - 'type|T=MIME-type' - (force MIME type)
      +
      + 'type|T=MIME-type' + (force MIME type)
      Force the MIME-type of the target file to be MIME-type. This can be used to set up the content-type based on some conditions. @@ -1504,8 +1503,8 @@

      RewriteRule ^(.+\.php)s$ $1 [T=application/x-httpd-php-source]

      -
    • -
    + +

Per-directory Rewrites

Modified: httpd/httpd/trunk/docs/manual/mod/mod_rewrite.xml URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/mod/mod_rewrite.xml?view=diff&rev=561918&r1=561917&r2=561918 ============================================================================== --- httpd/httpd/trunk/docs/manual/mod/mod_rewrite.xml (original) +++ httpd/httpd/trunk/docs/manual/mod/mod_rewrite.xml Wed Aug 1 12:04:21 2007 @@ -1268,9 +1268,9 @@ directive. Flags is a comma-separated list, surround by square brackets, of any of the following flags:

-
    -
  • 'chain|C' - (chained with next rule)
    +
    +
    'chain|C' + (chained with next rule)
    This flag chains the current rule with the next rule (which itself can be chained with the following rule, and so on). This has the following effect: if a rule @@ -1280,21 +1280,21 @@ rules are skipped. For instance, it can be used to remove the ``.www'' part, inside a per-directory rule set, when you let an external redirect happen (where the - ``.www'' part should not occur!).
  • + ``.www'' part should not occur!). -
  • - 'cookie|CO=NAME:VAL:domain[:lifetime[:path]]' - (set cookie)
    +
    + 'cookie|CO=NAME:VAL:domain[:lifetime[:path]]' + (set cookie)
    This sets a cookie in the client's browser. The cookie's name is specified by NAME and the value is VAL. The domain field is the domain of the cookie, such as '.apache.org', the optional lifetime is the lifetime of the cookie in minutes, and the optional - path is the path of the cookie
  • + path is the path of the cookie -
  • - 'env|E=VAR:VAL' - (set environment variable)
    +
    + 'env|E=VAR:VAL' + (set environment variable)
    This forces an environment variable named VAR to be set to the value VAL, where VAL can contain regexp backreferences ($N and @@ -1305,35 +1305,35 @@ var="VAR"-->) or CGI ($ENV{'VAR'}). You can also dereference the variable in a later RewriteCond pattern, using %{ENV:VAR}. Use this to strip - information from URLs, while maintaining a record of that information.
  • + information from URLs, while maintaining a record of that information. -
  • 'forbidden|F' (force URL - to be forbidden)
    +
    'forbidden|F' (force URL + to be forbidden)
    This forces the current URL to be forbidden - it immediately sends back a HTTP response of 403 (FORBIDDEN). Use this flag in conjunction with appropriate RewriteConds to conditionally block some - URLs.
  • + URLs. -
  • 'gone|G' (force URL to be - gone)
    +
    'gone|G' (force URL to be + gone)
    This forces the current URL to be gone - it immediately sends back a HTTP response of 410 (GONE). Use - this flag to mark pages which no longer exist as gone.
  • + this flag to mark pages which no longer exist as gone. -
  • - 'handler|H=Content-handler' - (force Content handler)
    +
    + 'handler|H=Content-handler' + (force Content handler)
    Force the Content-handler of the target file to be Content-handler. For instance, this can be used to simulate the mod_alias directive ScriptAlias, which internally forces all files inside the mapped directory to have a handler of - ``cgi-script''.
  • + ``cgi-script''. -
  • 'last|L' - (last rule)
    Stop the rewriting process +
    'last|L' + (last rule)
    Stop the rewriting process here and don't apply any more rewrite rules. This corresponds to the Perl last command or the break command in C. Use this flag to prevent the @@ -1343,31 +1343,31 @@ redirect (which frequently occurs when rewriting in a per-directory context), this will reinject the request and will cause processing to be repeated starting from the first - RewriteRule.
  • + RewriteRule. -
  • 'next|N' - (next round)
    +
    'next|N' + (next round)
    Re-run the rewriting process (starting again with the first rewriting rule). This time, the URL to match is no longer the original URL, but rather the URL returned by the last rewriting rule. This corresponds to the Perl next command or the continue command in C. Use this flag to restart the rewriting process - - to immediately go to the top of the loop.
    + to immediately go to the top of the loop. Be careful not to create an infinite - loop!
  • + loop! -
  • 'nocase|NC' - (no case)
    +
    'nocase|NC' + (no case)
    This makes the Pattern case-insensitive, ignoring difference between 'A-Z' and 'a-z' when Pattern is matched against the current - URL.
  • + URL. -
  • - 'noescape|NE' - (no URI escaping of - output)
    +
    + 'noescape|NE' + (no URI escaping of + output)
    This flag prevents mod_rewrite from applying the usual URI escaping rules to the result of a rewrite. Ordinarily, special characters (such as '%', '$', ';', and so on) @@ -1380,13 +1380,13 @@ which would turn '/foo/zed' into a safe request for '/bar?arg=P1=zed'. -
  • + -
  • - 'nosubreq|NS' - (not for internal - sub-requests)
    - This flag forces the rewriting engine to skip a +
    + 'nosubreq|NS' + (not for internal + sub-requests)
    +

    This flag forces the rewriting engine to skip a rewriting rule if the current request is an internal sub-request. For instance, sub-requests occur internally in Apache when mod_include tries to find out @@ -1394,17 +1394,17 @@ (index.xxx files). On sub-requests it is not always useful, and can even cause errors, if the complete set of rules are applied. Use this flag to - exclude some rules.
    - To decide whether or not to use this rule: if you + exclude some rules.

    +

    To decide whether or not to use this rule: if you prefix URLs with CGI-scripts, to force them to be processed by the CGI-script, it's likely that you will run into problems (or significant overhead) on - sub-requests. In these cases, use this flag. -

  • + sub-requests. In these cases, use this flag.

    + -
  • - 'proxy|P' (force - proxy)
    +
    + 'proxy|P' (force + proxy)
    This flag forces the substitution part to be internally sent as a proxy request and immediately (rewrite processing stops here) put through the Note: mod_proxy must be enabled in order to use this flag.

    -
  • + -
  • - 'passthrough|PT' - (pass through to next - handler)
    +
    + 'passthrough|PT' + (pass through to next + handler)
    This flag forces the rewrite engine to set the uri field of the internal request_rec structure to the value of the @@ -1461,60 +1461,59 @@

    The PT flag implies the L flag: rewriting will be stopped in order to pass the request to the next phase of processing.

    -
  • + -
  • 'qsappend|QSA' - (query string - append)
    +
    'qsappend|QSA' + (query string + append)
    This flag forces the rewrite engine to append a query string part of the substitution string to the existing string, instead of replacing it. Use this when you want to add more - data to the query string via a rewrite rule.
  • + data to the query string via a rewrite rule. -
  • 'redirect|R - [=code]' (force redirect)
    -

    Prefix Substitution with +

    'redirect|R + [=code]' (force redirect)
    +

    Prefix Substitution with http://thishost[:thisport]/ (which makes the new URL a URI) to force a external redirection. If no code is given, a HTTP response of 302 (MOVED - TEMPORARILY) will be returned. If you want to use other response - codes, simply specify the appropriate number - or use one of the following symbolic names: - temp (default), permanent, - seeother. Use this for rules to - canonicalize the URL and return it to the client - to - translate ``/~'' into - ``/u/'', or to always append a slash to - /u/user, etc.
    - Note: When you use this flag, make - sure that the substitution field is a valid URL! Otherwise, - you will be redirecting to an invalid location. Remember - that this flag on its own will only prepend - http://thishost[:thisport]/ to the URL, and rewriting - will continue. Usually, you will want to stop rewriting at this point, - and redirect immediately. To stop rewriting, you should add - the 'L' flag.

    + TEMPORARILY) will be returned. If you want to use other + response codes, simply specify the appropriate number or use + one of the following symbolic names: temp + (default), permanent, + seeother. Use this for rules to canonicalize + the URL and return it to the client - to translate + ``/~'' into ``/u/'', or to always + append a slash to /u/user, etc.
    + Note: When you use this flag, make sure + that the substitution field is a valid URL! Otherwise, you + will be redirecting to an invalid location. Remember that + this flag on its own will only prepend + http://thishost[:thisport]/ to the URL, and + rewriting will continue. Usually, you will want to stop + rewriting at this point, and redirect immediately. To stop + rewriting, you should add the 'L' flag.

    While this is typically used for redirects, any valid status code can be given here. If the status code is outside the redirect range (300-399), then the Substitution string is dropped and rewriting is stopped as if the L flag was used.

    -
  • + -
  • 'skip|S=num' - (skip next rule(s))
    +
    'skip|S=num' + (skip next rule(s))
    This flag forces the rewriting engine to skip the next num rules in sequence, if the current rule matches. Use this to make pseudo if-then-else constructs: The last rule of the then-clause becomes skip=N, where N is the number of rules in the else-clause. (This is not the same as the - 'chain|C' flag!)
  • + 'chain|C' flag!) -
  • - 'type|T=MIME-type' - (force MIME type)
    +
    + 'type|T=MIME-type' + (force MIME type)
    Force the MIME-type of the target file to be MIME-type. This can be used to set up the content-type based on some conditions. @@ -1524,8 +1523,8 @@ RewriteRule ^(.+\.php)s$ $1 [T=application/x-httpd-php-source] -
  • -
+ + Per-directory Rewrites