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

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -