這是工作:.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