You cannot match "query terms" (everything after the ? in the URL) by using just RewriteRule. You need to use RewriteCond statements along with a RewriteRule. This is a common mistake made by novice users of Apache mod_rewrite. If you really really really must use a redirect... I'd recommend reading the mod_rewrite documentation from Apache or doing some searches for how to match "query terms" with mod_rewrite.
It sounds like you want some extra template code to always be inserted into the page when a product is in a certain "category"... if this is correct, adding an additional (and unnecessary) redirect does not seem like the best solution...
If you want to match based upon master category:
You can get the product's master category id by using the built in Zen Cart function zen_get_products_category_id($product_id)...
If you need the entire cPath, you can use the built in Zen Cart function zen_get_product_path($products_id)...
If you want to match based upon the parent category:
You can use a SQL query to obtain the parent category id for the product...
If you need the entire cPath use the built in Zen Cart function zen_get_generated_category_path_rev($categories_id)...



Reply With Quote
