Return-Path: Delivered-To: apmail-httpd-users-archive@www.apache.org Received: (qmail 1791 invoked from network); 16 Jun 2006 13:43:40 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 16 Jun 2006 13:43:40 -0000 Received: (qmail 83066 invoked by uid 500); 16 Jun 2006 13:43:29 -0000 Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 83053 invoked by uid 500); 16 Jun 2006 13:43:29 -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 83042 invoked by uid 99); 16 Jun 2006 13:43:29 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Jun 2006 06:43:29 -0700 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_RFC_ABUSE X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [193.56.241.12] (HELO polaris.atos-infogerance.fr) (193.56.241.12) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Jun 2006 06:43:27 -0700 Received: from persee.atos-infogerance.fr ([193.56.47.18]) by polaris.atos-infogerance.fr (8.13.6/8.13.6) with ESMTP id k5GDh46o018420 for ; Fri, 16 Jun 2006 15:43:04 +0200 (MET DST) Received: from exchange2k301.gaia.fr ([150.175.10.40]) by persee.atos-infogerance.fr (8.13.5/8.13.5) with ESMTP id k5GDgwOf025486 for ; Fri, 16 Jun 2006 14:43:04 +0100 (WET DST) X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Date: Fri, 16 Jun 2006 15:42:58 +0200 Message-ID: <8C29B2F93BAE9047A906EF6D6F9C5D43022A45E3@exchange2k301.gaia.fr> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [users@httpd] mod_rewrite and multiple parameters Thread-Index: AcaRRIs4fgcjqtvPQ5GrVYicorqneQABF1YA From: =?iso-8859-1?Q?Axel-St=E9phane__SMORGRAV?= To: X-Virus-Checked: Checked by ClamAV on apache.org Subject: RE: [users@httpd] mod_rewrite and multiple parameters X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Here you go: RewriteRule ^/seach/(.*) /myscript.php/$1 RewriteRule ^/myscript.php/([a-z])([0-9]+)/(.*) = /myscript.php/$3?param_$1=3D$2 [QSA,N] RewriteRule ^/myscript.php/([a-z])([0-9]+)$ /myscript.php?param_$1=3D$2 = [QSA,L] -ascs -----Original Message----- From: news [mailto:news@sea.gmane.org] On Behalf Of Gioele Barabucci Sent: Friday, June 16, 2006 2:57 PM To: users@httpd.apache.org Subject: [users@httpd] mod_rewrite and multiple parameters Hi, I use mod_rewrite to map URLs like this = http://mydomain/seach/a10/b30/c9/f99 to myscript.php?param_a=3D10¶m_b=3D30¶m_c_new=3D9¶m_f=3D99. Everithing works fine but, as the number of (optional) parameters = increase, I need to create too many RewriteRules. My RewriteRules are like this RewriteRule ^a([0-9]*)$ myscript.php?param_a=3D$1 RewriteRule = ^b([0-9]*)$ myscript.php?param_b=3D$1 ... RewriteRule ^f([0-9]*)$ myscript.php?param_f=3D$1 RewriteRule ^a([0-9]*)/b([0-9]*)$ myscript.php?param_a=3D$1¶m_b=3D$2 RewriteRule ^a([0-9]*)/c([0-9]*)$ myscript.php?param_a=3D$1¶m_c=3D$2 ... RewriteRule ^a([0-9]*)/f([0-9]*)$ myscript.php?param_a=3D$1¶m_f=3D$2 RewriteRule ^b([0-9]*)/c([0-9]*)$ myscript.php?param_b=3D$1¶m_c=3D$2 ... RewriteRule ^e([0-9]*)/f([0-9]*)$ myscript.php?param_e=3D$1¶m_f=3D$2 RewriteRule ^a([0-9]*)/b([0-9]*)/c([0-9])$ myscript.php?param_a=3D... and so on. Is there a way to say * let's start with url =3D 'myscript.php?' * if a([0-9]*) matches; url +=3D param_a=3D$1 * if b([0-9]*) matches; url +=3D param_b=3D$1 * if c([0-9]*) matches, url +=3D param_c=3D$1 ... * at the end connect to url. -- Gioele --------------------------------------------------------------------- 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 --------------------------------------------------------------------- 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