From: Rich Bowen Date: Tue, 21 Sep 2010 13:23:57 +0000 (+0000) Subject: Adds the -le, -lt, -eq, -ge, and -gt test flags added by wrowe. X-Git-Tag: 2.3.9~471 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4104c4cde1fcee0bf10bea15142db45069506253;p=thirdparty%2Fapache%2Fhttpd.git Adds the -le, -lt, -eq, -ge, and -gt test flags added by wrowe. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@999401 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/docs/manual/mod/mod_rewrite.html.en b/docs/manual/mod/mod_rewrite.html.en index 6b599bdf9cb..5f6aaae2c78 100644 --- a/docs/manual/mod/mod_rewrite.html.en +++ b/docs/manual/mod/mod_rewrite.html.en @@ -403,9 +403,10 @@ RewriteRule ^index\.html$ newsite.html TestString is first evaluated, before being matched against CondPattern.

-

Remember: CondPattern is a - perl compatible regular expression with some - additions:

+

CondPattern is usually a + perl compatible regular expression, but there is + additional syntax available to perform other useful tests against + the Teststring:

  1. You can prefix the pattern string with a @@ -413,9 +414,7 @@ RewriteRule ^index\.html$ newsite.html non-matching pattern.
  2. - There are some special variants of CondPatterns. - Instead of real regular expression strings you can also - use one of the following: + You can perform lexicographical string comparisons:
    • '<CondPattern' (lexicographically @@ -457,7 +456,55 @@ RewriteRule ^index\.html$ newsite.html if TestString lexicographically follows CondPattern, or is equal to CondPattern (the two strings are equal, character for character).
    • +
  3. +
  4. + You can perform integer comparisons: +
      + +
    • '-eq' (is numerically + equal to)
      + The TestString is treated as an integer, and is + numerically compared to the CondPattern. True if + the two are numerically equal.
    • + +
    • '-ge' (is numerically + greater than or equal to)
      + The TestString is treated as an integer, and is + numerically compared to the CondPattern. True if + the TestString is numerically greater than or equal + to the CondPattern.
    • + +
    • '-gt' (is numerically + greater than)
      + The TestString is treated as an integer, and is + numerically compared to the CondPattern. True if + the TestString is numerically greater than + the CondPattern.
    • + +
    • '-le' (is numerically + less than or equal to)
      + The TestString is treated as an integer, and is + numerically compared to the CondPattern. True if + the TestString is numerically less than or equal + to the CondPattern. Avoid confusion with the + -l by using the -L or + -h variant.
    • + +
    • '-lt' (is numerically + less than)
      + The TestString is treated as an integer, and is + numerically compared to the CondPattern. True if + the TestString is numerically less than + the CondPattern. Avoid confusion with the + -l by using the -L or + -h variant.
    • + +
    +
  5. + +
  6. You can perform various file attribute tests: +
    • '-d' (is directory)
      Treats the TestString as a pathname and tests @@ -485,7 +532,8 @@ RewriteRule ^index\.html$ newsite.html whether or not it exists, and is a symbolic link. May also use the bash convention of -L or -h if there's a possibility of confusion - such as when using the -lt test.
    • + such as when using the -lt or + -le tests.
    • '-L' (is symbolic link, bash convention)
      See -l.
    • diff --git a/docs/manual/mod/mod_rewrite.xml b/docs/manual/mod/mod_rewrite.xml index 39d1a51e337..50d475e4b45 100644 --- a/docs/manual/mod/mod_rewrite.xml +++ b/docs/manual/mod/mod_rewrite.xml @@ -557,9 +557,10 @@ RewriteRule ^index\.html$ newsite.html TestString is first evaluated, before being matched against CondPattern.

      -

      Remember: CondPattern is a - perl compatible regular expression with some - additions:

      +

      CondPattern is usually a + perl compatible regular expression, but there is + additional syntax available to perform other useful tests against + the Teststring:

      1. You can prefix the pattern string with a @@ -567,9 +568,7 @@ RewriteRule ^index\.html$ newsite.html non-matching pattern.
      2. - There are some special variants of CondPatterns. - Instead of real regular expression strings you can also - use one of the following: + You can perform lexicographical string comparisons:
        • '<CondPattern' (lexicographically @@ -611,7 +610,55 @@ RewriteRule ^index\.html$ newsite.html if TestString lexicographically follows CondPattern, or is equal to CondPattern (the two strings are equal, character for character).
        • +
      3. +
      4. + You can perform integer comparisons: +
          + +
        • '-eq' (is numerically + equal to)
          + The TestString is treated as an integer, and is + numerically compared to the CondPattern. True if + the two are numerically equal.
        • + +
        • '-ge' (is numerically + greater than or equal to)
          + The TestString is treated as an integer, and is + numerically compared to the CondPattern. True if + the TestString is numerically greater than or equal + to the CondPattern.
        • + +
        • '-gt' (is numerically + greater than)
          + The TestString is treated as an integer, and is + numerically compared to the CondPattern. True if + the TestString is numerically greater than + the CondPattern.
        • + +
        • '-le' (is numerically + less than or equal to)
          + The TestString is treated as an integer, and is + numerically compared to the CondPattern. True if + the TestString is numerically less than or equal + to the CondPattern. Avoid confusion with the + -l by using the -L or + -h variant.
        • + +
        • '-lt' (is numerically + less than)
          + The TestString is treated as an integer, and is + numerically compared to the CondPattern. True if + the TestString is numerically less than + the CondPattern. Avoid confusion with the + -l by using the -L or + -h variant.
        • + +
        +
      5. + +
      6. You can perform various file attribute tests: +
        • '-d' (is directory)
          Treats the TestString as a pathname and tests @@ -639,7 +686,8 @@ RewriteRule ^index\.html$ newsite.html whether or not it exists, and is a symbolic link. May also use the bash convention of -L or -h if there's a possibility of confusion - such as when using the -lt test.
        • + such as when using the -lt or + -le tests.
        • '-L' (is symbolic link, bash convention)
          See -l.