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

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -