I have the next RewriteRule
for being able of access to
domain.com/section/products/whatever
from the folder called _products
. The original URL looks like this:
domain.com/section/_products/product.php?param=whatever
This is that rule:
RewriteRule ^section/products/(.*)$ section/_products/$1 [L,NC]
Now I need to rewrite this URL:
domain.com/section/products/brand/index.php?brand=apple
To this one:
domain.com/section/products/brand/apple
I'm trying with this:
Options -Indexes
Options +FollowSymlinks
Options -MultiViews
RewriteEngine on
RewriteBase /
RewriteRule ^section/products/(.*)$ section/_products/$1 [L,NC]
RewriteRule ^(section/products/brand)/([\w-]+)$ /section/_products/brand/index.php?brand=$1 [QSA,L,NC]
Also with this:
RewriteRule ^(section/products/brand)/([\w-]+)$ /section/products/brand/index.php?brand=$1 [QSA,L,NC]
None of those two are working for me.
Should the section/_products/$1
rule go after or before the other rule?
I can't find the right logic.