Multiple rule Apache rewrite
Solution 1:
It looks like you've chained all the rules together with the [C]
flag. See the documentation for an explanation of their meanings. You probably want [L]
for "last" instead.
It's also worth noting that the rules will be run until the URL does not change any longer; so your second-to-last rule will likely create a rewrite loop, unless you have a rule before it similar to this:
RewriteRule ^/mr/index.php$ - [L]
Edit: For clarity, this is what I'd suggest as a starting point. You may get some insight from the logging provided by mod_rewrite
.
RewriteRule ^mr/index.php$ - [L]
RewriteRule ^([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/?$ /mr/index.php?product_group=$1&product_family=$2&product_category=$3&product_sub_category=$4&product=$5 [L]
RewriteRule ^([^/]*)/([^/]*)/([^/]*)/([^/]*)/?$ /mr/index.php?product_group=$1&product_family=$2&product_category=$3&product_sub_category=$4 [L]
RewriteRule ^([^/]*)/([^/]*)/([^/]*)/?$ /mr/index.php?product_group=$1&product_family=$2&product_category=$3 [L]
RewriteRule ^([^/]*)/([^/]*)/?$ /mr/index.php?product_group=$1&product_family=$2 [L]
RewriteRule ^([^/]*)/?$ /mr/index.php?product_group=$1 [L]