From apache-httpd-users Fri Jun 16 12:57:09 2006 From: Gioele Barabucci Date: Fri, 16 Jun 2006 12:57:09 +0000 To: apache-httpd-users Subject: [users@httpd] mod_rewrite and multiple parameters Message-Id: X-MARC-Message: https://marc.info/?l=apache-httpd-users&m=115046269511216 Hi, I use mod_rewrite to map URLs like this http://mydomain/seach/a10/b30/c9/f99 to myscript.php?param_a=10¶m_b=30¶m_c_new=9¶m_f=99. 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=$1 RewriteRule ^b([0-9]*)$ myscript.php?param_b=$1 ... RewriteRule ^f([0-9]*)$ myscript.php?param_f=$1 RewriteRule ^a([0-9]*)/b([0-9]*)$ myscript.php?param_a=$1¶m_b=$2 RewriteRule ^a([0-9]*)/c([0-9]*)$ myscript.php?param_a=$1¶m_c=$2 ... RewriteRule ^a([0-9]*)/f([0-9]*)$ myscript.php?param_a=$1¶m_f=$2 RewriteRule ^b([0-9]*)/c([0-9]*)$ myscript.php?param_b=$1¶m_c=$2 ... RewriteRule ^e([0-9]*)/f([0-9]*)$ myscript.php?param_e=$1¶m_f=$2 RewriteRule ^a([0-9]*)/b([0-9]*)/c([0-9])$ myscript.php?param_a=... and so on. Is there a way to say * let's start with url = 'myscript.php?' * if a([0-9]*) matches; url += param_a=$1 * if b([0-9]*) matches; url += param_b=$1 * if c([0-9]*) matches, url += param_c=$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