Return-Path: Delivered-To: apmail-httpd-users-archive@www.apache.org Received: (qmail 30229 invoked from network); 14 May 2007 15:13:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 14 May 2007 15:13:01 -0000 Received: (qmail 38114 invoked by uid 500); 14 May 2007 15:12:57 -0000 Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 38100 invoked by uid 500); 14 May 2007 15:12:57 -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 38089 invoked by uid 99); 14 May 2007 15:12:57 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 May 2007 08:12:57 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of arthur@bluechip.ro designates 212.93.137.210 as permitted sender) Received: from [212.93.137.210] (HELO vader.ccina.ro) (212.93.137.210) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 14 May 2007 08:12:50 -0700 Received: (qmail 17803 invoked by uid 517); 14 May 2007 15:07:07 -0000 Received: from 89.120.226.27 by vader.ccina.ro (envelope-from , uid 508) with qmail-scanner-1.25st (clamdscan: 0.90.1/3240. spamassassin: 3.1.0. perlscan: 1.25st. Clear:RC:0(89.120.226.27):SA:0(-1.2/5.0):. Processed in 3.390451 secs); 14 May 2007 15:07:07 -0000 X-Qmail-Scanner-Mail-From: arthur@bluechip.ro via vader.ccina.ro X-Qmail-Scanner: 1.25st (Clear:RC:0(89.120.226.27):SA:0(-1.2/5.0):. Processed in 3.390451 secs Process 17794) X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on vader.ccina.ro X-Spam-Level: X-Envelope-From: arthur@bluechip.ro Received: from unknown (HELO ?192.168.3.100?) (89.120.226.27) by vader.ccina.ro with SMTP; 14 May 2007 15:07:03 -0000 Message-ID: <46487C57.6050703@bluechip.ro> Date: Mon, 14 May 2007 18:12:23 +0300 From: Arthur Kerpician User-Agent: Thunderbird 1.5.0.10 (Windows/20070221) MIME-Version: 1.0 To: users@httpd.apache.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Old-Spam-Status: No, hits=-1.2 required=5.0 X-Old-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00,SPF_SOFTFAIL autolearn=no version=3.1.0 Subject: [users@httpd] rewrite rules optimisation Hi, Im having trouble with defining some rules. This is the layout: I want to send some GET vars in the URL like this: http://localhost/a-1,b-2,c-3,d-4/ Based on this format, the rewriting engine should forward the request like this: http://localhost/index.php?a=1&b=2&c=3&d=4 I know I can write a rule like this: RewriteRule /a-([0-9]+),b-([0-9]+),c-([0-9]+),d-([0-9]+) /index.php?a=$1&b=$2&c=$3&d=$1 The problem is that one or more of these vars can be missing (some of them are filters, order by data info) or can be send in a different position than the one defined by the rule, something like this: http://localhost/d-1,a-2/ (should rewrite to http://localhost/index.php?d=1&a=2) or http://localhost/c-1/ (should rewrite to http://localhost/index.php?c=1) The hard way, as I see it, is to take into account all combinations / possibilities and write a rule for each and every case. Im not a even close to be a mod_rewrite fair user but I know there should be an easier (optimised) way of doing this. Thanks all for your input, Arthur --------------------------------------------------------------------- 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