Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 2B4F4200B69 for ; Sat, 20 Aug 2016 21:25:10 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 29B9C160ABB; Sat, 20 Aug 2016 19:25:10 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 7120B160A76 for ; Sat, 20 Aug 2016 21:25:09 +0200 (CEST) Received: (qmail 49053 invoked by uid 500); 20 Aug 2016 19:25:08 -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 49044 invoked by uid 99); 20 Aug 2016 19:25:08 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 20 Aug 2016 19:25:08 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 28041180462 for ; Sat, 20 Aug 2016 19:25:08 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.426 X-Spam-Level: X-Spam-Status: No, score=-0.426 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-1.426] autolearn=disabled Received: from mx2-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id CnTyiFnfHhhi for ; Sat, 20 Aug 2016 19:25:07 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx2-lw-us.apache.org (ASF Mail Server at mx2-lw-us.apache.org) with ESMTP id B59265FB3D for ; Sat, 20 Aug 2016 19:25:06 +0000 (UTC) Received: from svn01-us-west.apache.org (svn.apache.org [10.41.0.6]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 2D31FE0054 for ; Sat, 20 Aug 2016 19:25:06 +0000 (UTC) Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id 2A62D3A0184 for ; Sat, 20 Aug 2016 19:25:06 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1757028 - /httpd/httpd/trunk/docs/manual/mod/mod_rewrite.html.en Date: Sat, 20 Aug 2016 19:25:06 -0000 To: cvs@httpd.apache.org From: covener@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20160820192506.2A62D3A0184@svn01-us-west.apache.org> archived-at: Sat, 20 Aug 2016 19:25:10 -0000 Author: covener Date: Sat Aug 20 19:25:05 2016 New Revision: 1757028 URL: http://svn.apache.org/viewvc?rev=1757028&view=rev Log: xforms Modified: httpd/httpd/trunk/docs/manual/mod/mod_rewrite.html.en 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?rev=1757028&r1=1757027&r2=1757028&view=diff ============================================================================== --- httpd/httpd/trunk/docs/manual/mod/mod_rewrite.html.en (original) +++ httpd/httpd/trunk/docs/manual/mod/mod_rewrite.html.en Sat Aug 20 19:25:05 2016 @@ -1048,32 +1048,37 @@ RewriteRule "^/$" "/hom on where the RewriteRule directive is defined.

What is matched?

-

In VirtualHost context, + +

    +
  • In VirtualHost context, The Pattern will initially be matched against the part of the URL after the hostname and port, and before the query string (e.g. "/app1/index.html"). - This is the (%-decoded) URL-path.

    + This is the (%-decoded) URL-path.

  • + +
  • In Directory and htaccess context, + the Pattern is matched against only a partial path, for example a request + of "/app1/index.html" may result in comparison against "app1/index.html" + or "index.html" depending on where the RewriteRule is + defined.

    + +

    In this context, only the trailing portion of the currently mapped + filesystem is compared against. The directory path where the rule is defined + is stripped before comparison (up to and including a trailing slash). + The net result of this per-directory prefix stripping is that rules in + this context only match against the portion of the currently mapped path + "below" where they are defined.

    -

    In Directory and htaccess context, - the Pattern is matched against the trailing portion of the currently - mapped filesystem path with the rules own directory path removed from the beginning - (up to and including a trailing slash). Directives such as DocumentRoot and Alias, or even the +

    Directives such as DocumentRoot and Alias, or even the result of previous RewriteRule substitutions, determine - the currently mapped filesystem path. The net result of this per-directory - prefix stripping is that rules in this context only match against the portion - of the currently mapped path "below" where they are defined.

    + the currently mapped filesystem path. +

    +
  • -

    If you wish to match against the hostname, port, or query string, use a +

  • If you wish to match against the hostname, port, or query string, use a RewriteCond with the %{HTTP_HOST}, %{SERVER_PORT}, or - %{QUERY_STRING} variables respectively.

    - -

    In any case, remember that regular expressions are substring - matches. That is, you don't need the regex to describe the entire - string, just the part that you wish to match. Thus, using a regex - of . is often sufficient rather than .*, - and the regex abc is not the same as - ^abc$.

    - + %{QUERY_STRING} variables respectively.

  • +

Per-directory Rewrites