We have built a search module for our eCommerce application & attempting to build SEO friendly pages.
The basic concept below works however when adding additional params to our search the rules no longer work correctly.
RewriteRule ^shop/([^/]*)/([^/]*)/([^/]*)/search/([^/]*)$ search.php?controller=$1&lang=$2&name=$3&search_keyword=$4 [L]
Example of search but needs to also work with categories selection when parameter exists. www.mysite.com/shop/lcd
Currently this is working but only supports 2 category sets as we have 2 rules and not working with the search, the problem is there could be as many as 20 category sets
RewriteRule ^shop/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)$ search.php?controller=$1&lang=$2&name=$3&categories=$4=$5 [L]
RewriteRule ^shop/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)$ search.php?controller=$1&lang=$2&name=$3&categories=$4=$5|$6=$7 [L]
www.mysite.com/shop/TV/Plasma+3D+Portable/ (TV is the main category with 3 subs)
www.mysite.com/shop/TV/Plasma+3D+Portable/Computers/Mac+PC+Laptops+Tablets/ (Computers is the main category with 4 subs combined with the above)
This needs to also work with additional param sets www.mysite.com/shop/TV/Plasma+3D+Portable/Computers/Mac+PC+Laptops+Tablets/manufacturers/brandA/brandB/brandC/
Please if someone can suggest a better way to write these rules to support all these additional parameter requests we would really appreciate your input.