apache - 2 rewrite rules not working together -
i have rewrite rule product detail page instead of url being
/product-detail.php?id=3765
it instead:
/blue-jeans
this rewrite rule:
rewriterule ^([0-9a-za-z-]+)$ product-detail.php?slug=$1 [nc,l]
however, need 1 regional dealers. add .htaccess, product detail rule stops working in blank page displayed when navigating product. how can them both work?
rewriterule ^([0-9a-za-z-]+)$ dealers.php?slug=$1 [nc,l]
it's because matching regex identical, , first 1 of them matches , you're done. need wrapping php script can sort out or have other token in regex limit scope. example products under /products , dealers under /dealers, , like:
rewriterule ^/dealers/([0-9a-za-z-]+)$ /dealers.php?slug=$1 [nc,l] rewriterule ^/products/([0-9a-za-z-]+)$ /products.php?slug=$1 [nc,l]
Comments
Post a Comment