php - mod_rewrite not working when page exists with same name -
i have page shirts.php lists shirts, , have page product.php?id=x, displays individual product information.
if write rule this:
rewriterule ^mens_shirts/([0-9]+)$ product.php?id=$1 [l]
and input url mens_shirts/22
displays product page correctly clean url.
however, if write rule follows:
rewriterule ^shirts/([0-9]+)$ product.php?id=$1 [l]
and input url /shirts/20
, instead of displaying product page, displays shirts.php.
give try:
options +followsymlinks -multiviews rewriteengine on rewritebase / rewriterule ^shirts/([0-9]+)$ product.php?id=$1 [nc,l]
i believe happens because have multiviews
enabled, disabling it, should let want. why, read here.
followsymlinks
- server follow symbolic links in directory.
Comments
Post a Comment