这是工作:.htacces重写规则问题
RewriteRule ^([a-z]{2}/){0,1}showCategory/([0-9]*)/([0-9]*)(/{0,1})$ /main.php?id=$2&il[lang]=$1&page=$3 [L]
这个网址:
http://localhost/showCategory/590/10
现在,我想这也工作:
http://localhost/showCategory/590/transport/10
我尝试的规则:
RewriteRule ^([a-z]{2}/){0,1}showCategory/([0-9]*)/([a-z\-_0-9\+]*)/([0-9]*)(/{0,1})$ /main.php?id=$2&il[lang]=$1&page=$3 [L]
如何更改RewriteRule
?
谢谢,没关系!它是如何工作的? – 2010-02-02 18:36:39
我用解释更新了答案 – adamJLev 2010-02-02 18:43:01
RewriteRule ^([az] {2} /){0,1} showCategory /([0-9] *)/ [az \ -_ 0-9 \ +] */mp/(。*)(/ {0,1})$ /main.php?id=$2&il[lang]=$1&$3 [L] RewriteRule ^([az] {2} /){0,1} showCategory /([0-9]*)/[az\-_0-9\+]*/(.*)/mp/(.*)(/{0,1})$ /main.php?id=$2 &[lang] = $ 1&page = $ 3&$ 4 [L] RewriteRule ^([az] {2} /){0,1} showCategory /([0-9] *)(/ {0,1})/ [az] -_ 0-9 \ +] * $ /main.php?id=$2&il[lang]=$1 [L] RewriteRule ^([az] {2} /){0,1} showCategory /([ 0-9] *)/ [az \ -_ 0-9 \ +] * /([0-9] *)(/ {0,1})$ \t \t \t \t \t /main.php?id=$2&il [lang] = $ 1&page = $ 3 [L] – 2010-02-02 19:19:17