Return-Path: Delivered-To: apmail-httpd-users-archive@www.apache.org Received: (qmail 98967 invoked from network); 23 Feb 2005 16:33:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 23 Feb 2005 16:33:49 -0000 Received: (qmail 12973 invoked by uid 500); 23 Feb 2005 16:33:39 -0000 Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 12956 invoked by uid 500); 23 Feb 2005 16:33:38 -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: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 12941 invoked by uid 99); 23 Feb 2005 16:33:38 -0000 X-ASF-Spam-Status: No, hits=0.1 required=10.0 tests=FORGED_RCVD_HELO X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from mailhost.westcoast.co.uk (HELO marge.westcoast.ltd.uk) (81.144.251.100) by apache.org (qpsmtpd/0.28) with ESMTP; Wed, 23 Feb 2005 08:33:37 -0800 Received: from nickgushlow.westcoast.ltd.uk by marge; 23 Feb 2005 16:33:33 +0000 From: Nick Gushlow Reply-To: nick.gushlow@westcoast.co.uk To: users@httpd.apache.org In-Reply-To: References: Content-Type: text/plain Content-Transfer-Encoding: 7bit Organization: Westcoast Limited Date: Wed, 23 Feb 2005 16:33:33 +0000 Message-Id: <1109176413.4224.5.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 (2.0.2-3) X-Virus-Checked: Checked Subject: RE: [users@httpd] Rewrite If Statements X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N On Wed, 2005-02-23 at 16:20 +0100, Boyle Owen wrote: > You can achieve this using the "S" flag to the RewriteRule. This causes > mod_rewrite to "skip" the next N rules. For example: > > if (condition_1) > rule_1 > else > rule_2 > > is implemented by: > > RewriteCond condition_1 > RewriteRule rule_1 [S=1] > RewriteRule rule_2 > > This is the fundamental logic element (if-then-else). Note that this > just allows a two-way switch. It doesn't give you the full multiplex > switching (case-statement) that you might need. You might get away with: > > RewriteCond condition_1 > RewriteRule rule_1 > > RewriteCond condition_2 > RewriteRule rule_2 [S=1] > RewriteRule rule_3 > > so long as condition_1 and condition_2 are mutually exclusive (ie, can't > both be true). Ah ok, that looks like what I need; wasn't sure I could separate conditions and rules. Thanks, Nick. --------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See for more info. To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org " from the digest: users-digest-unsubscribe@httpd.apache.org For additional commands, e-mail: users-help@httpd.apache.org