multiple variables, some NOT requierd

Discuss practical ways rearrange URLs using mod_rewrite.

multiple variables, some NOT requierd

Postby summer » Wed Oct 08, 2003 2:59 pm

Hi -
I'm trying to figure out the best way to get up to 6 variable to my PHP script and I'm looking for ideas. This is a browse page of a product catalog that can have any number (0-6) of different variables passed to it.

I was hoping I could do something like this:

www.domain.com/products/browse/1//3/
would map to:
/products/browse.php?CategoryID=1&MarketspaceID=&ApplicationID=3&CpuID=&IoID=&SystemID=

here's what I've got so far

RewriteRule ^products/browse/([0-9]*)(/?)([0-9]*)(/?)([0-9]*)(/?)([0-9]*)(/?)([0-9]*)(/?)([0-9]*)(/?)$ /products/browse.php?CategoryID=$1&MarketspaceID=$3&ApplicationID=$5&CpuID=$7&IoID=$9&SystemID=$11

which kinda works, but doesn't seem to realize that I'm looking for 0-X number of numbers between slashes and has 11 different variables which is more then alowed. Any ideas?

thanks in advance,
summer
summer
 

Return to Friendly URLs with Mod_Rewrite

Who is online

Users browsing this forum: No registered users and 21 guests

cron