regex - How to Rewrite a url in a subdirectory and parameters? -


here page i'm working with:

www.domain.com/clothing/mens/brand.html?brand=dope

i change to:

www.domain.com/clothing/mens/dope

i'm using:

rewriteengine on rewriterule  ^mens/brand/([0-9a-za-z]+) mens/brand.php?brand=$1 [nc,l] 

but produces undesired effect:

www.domain.com/clothing/mens/brand/dope

when remove "brand":

rewriterule  ^mens/([0-9a-za-z]+) mens/brand.php?brand=$1 [nc,l] 

i don't error blank page. what doing wrong? have tried , nothing seems work :(

try this:

rewriteengine on rewriterule  ^clothing/mens/([0-9a-za-z]+) /clothing/mens/brand.html?brand=$1 [nc,l] 

the page working brand.html or brand.php?


Comments