Return-Path: X-Original-To: apmail-httpd-users-archive@www.apache.org Delivered-To: apmail-httpd-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 35415D6C6 for ; Fri, 17 Aug 2012 10:41:19 +0000 (UTC) Received: (qmail 67747 invoked by uid 500); 17 Aug 2012 10:41:16 -0000 Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 67725 invoked by uid 500); 17 Aug 2012 10:41:15 -0000 Mailing-List: contact users-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: users@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 67707 invoked by uid 99); 17 Aug 2012 10:41:15 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Aug 2012 10:41:15 +0000 X-ASF-Spam-Status: No, hits=-0.5 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of lazy404@gmail.com designates 209.85.212.45 as permitted sender) Received: from [209.85.212.45] (HELO mail-vb0-f45.google.com) (209.85.212.45) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Aug 2012 10:41:08 +0000 Received: by vbip1 with SMTP id p1so3979659vbi.18 for ; Fri, 17 Aug 2012 03:40:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=B5OpCtfbdYWBkhVrZshsvB9Rd5mE1s6w1yPQX45k6s0=; b=DvIeJO1Tddn1P8kg0pRV0m+ckgvTsIxWI0SGkP1t06QyrUiLCkQedTcM3xkB/Rx/xp iQw1MXhhKXkYKzwVTnbo1BHHx1t69vIJW75E5LLBo6/1lW/wAnzMYv2O5f0JVDXhDexx DT1Cpdqy6iMbWaOM0oM9TTiSRwApE4GngUiFvGuBCRgEXPP6i/TRFbcB3lFJ1LczLVfz qZdbOU5cHbSpJ0Y2gO7frs8AVD2qTfxg++V00m8vT6ft4ekyYt8Ooa/ZZvPZkAJKSbin MENdreCQ+R7gAai6vTD9QfSp0Tlcb7kHdVcGmP8acHjpffX+AaaYdnWfCLavDaB9vXKA wa2A== MIME-Version: 1.0 Received: by 10.52.21.174 with SMTP id w14mr1741691vde.24.1345200047433; Fri, 17 Aug 2012 03:40:47 -0700 (PDT) Received: by 10.58.15.6 with HTTP; Fri, 17 Aug 2012 03:40:47 -0700 (PDT) In-Reply-To: References: Date: Fri, 17 Aug 2012 12:40:47 +0200 Message-ID: From: Lazy To: users@httpd.apache.org Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [users@httpd] RewriteCond backreference in virtualhost context 2012/8/17 Igor Cicimov : > Im really surprised your RewriteCond worked at all in any Apache version as > it doesn't make sense to me. The $1 at the end has a meaning of variable > which in your case has a value of ... what? Maybe if you tell us whar r you > trying to do someone can help you. > > On Aug 17, 2012 8:01 PM, "Lazy" wrote: >> >> Hi All, >> >> a simple mod_rewrite rules >> >> RewriteEngine On >> >> RewriteCond /home/docroot/test/$1 -f >> RewriteRule ^(.+).test$ /test/$1 [L] >> >> http://httpd.apache.org/docs/2.4/mod/mod_rewrite.html#rewritecond >> >> in apache 2.2.x this works in vhost and .htaccess context, in apache >> 2.4.2 in vhost context $1 in RewriteCond is always empty >> >> Is this a bug or I'm missing something ? >> please read the docs, " RewriteRule backreferences: These are backreferences of the form $N (0 <= N <= 9). $1 to $9 provide access to the grouped parts (in parentheses) of the pattern, from the RewriteRule which is subject to the current set of RewriteCond conditions. $0 provides access to the whole string matched by that pattern. " this rule redirects xxx.test to /test/xxx if /test/xxx is present This can be used as an simple static cache. Regards, Michal Grzedzicki --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org For additional commands, e-mail: users-help@httpd.apache.org