apache - htaccess complex rule for product searcher -
i need create complex rules product searcher. 3 rules, 4 or more values each.
the clean url should this:
www.domain.com/products/rule1-value4/rule2-value5/rule3-value2
the orginal url this:
www.domain.com/products?rule1[ ]=4&rule2[ ]=5&rule3[ ]=2
of course, combination of policies arbitrary, there aren't 3 htaccess rules should universal. there many possible combinations this:
rewriterule ^products/rule1-value3/?$ /products?rule1[]=3 [l]
i start create complex rule rewrite each rule , glue url on last line (for 2 rules , 1 value each test). , doesn't work. please help. i'm lame in complicated htaccess rules , regular expresions :)
rewriterule ^/products/?(.*)?(rule1-value1)(.*)? %{request_uri}?rule1[]=1 [qsa] rewriterule ^/products/?(.*)?(rule2-value3)(.*)? %{request_uri}?rule2[]=3 [qsa] rewriterule ^/products/^(.*)$ /products$1 [qsa,l]
Comments
Post a Comment