by passing variables. I can get this to work but I have to use the variable values within the re-written url, like so:
http://www.mysite.com/cheese-b-1-p-2.html
where b represents brand and p represents product. I need to pass the values through to the next page and retrieve them using $_GET.
IMHO, you’ve not got your head around your problem, i.e., category-brand-product does not translate to cheese-b-1-p-2 nor to cheese-edam-block-of-cheese. Without an ability to “map” your category, brand and product to the URI (and from the URI to the database in the target file), you will fail with any mod_rewrite attempt. Think: SPECIFICITY!
cheese - either provide a list of acceptable cheese types or require your “cheese” variable to be a test string of lowercase characters (NO -'s, no CAPS, nada!). Use ([a-z]+)- where the last - is the demarker character to separate the cheese from the brand.
brand - easier to specify the few acceptable brands (i.e., (Kraft|Borden|generic)- ).
product - could be either of the above - just be sure to eliminate the spaces or you’ll end up with %20 in their place!
Once you’ve got “specificity” like that, it’s easy to write the mod_rewrite code.