Forum Moderators: phranque
http://www.example.com/index.php?market=$1&product=&2&subcat=$3
You will either need to use a separate rule for each possible combination of present/not-present path-values, or us a single rewriterule with a specific RewriteCond for each possible combination of present/not-present path-values.
RewriteRule ^([^/]+)/([^/]+)/([^/]+)/$ index.php?m=$1&p=$2&s=$3 [L]
RewriteRule ^([^/]+)/([^/]+)/$ index.php?m=$1&p=$2 [L]
RewriteRule ^([^/]+)/$ index.php?m=$1 [L]
RewriteRule ^([^/]+)(/?)([^/]+)(/?)([^/]+)/$ index.php?m=$1&p=$3&s=$5 [L]