apache - .htaccess rewrite but it get wrong parameter -
that's link
a.http://domaim/category/para1 b.http://domaim/category/para1/ c.http://domaim/category/para1/para2 d.http://domaim/category/para1/para2/
paramater string (urlencode or others)
and that's .htacess
rewriteengine on rewriterule ^category/([^/]+)$ category.php?mid=$1 rewriterule ^category/([^/]+)/([^/]+)$ category.php?mid=$1&sid=$2
a , c right parameter,but b , d page no found!! error 404
then try modify .htacess wrong
rewriteengine on rewriterule ^category/(.*)$ category.php?mid=$1 rewriterule ^category/([^/]+)/(.*)$ category.php?mid=$1&sid=$2
check ending "/" too:
rewriteengine on rewriterule ^category/([^/]+)([/]{0,1})$ category.php?mid=$1 rewriterule ^category/([^/]+)/([^/]+)([/]{0,1})$ category.php?mid=$1&sid=$2
Comments
Post a Comment