/XXXXX/32/b0/category.php?id=32
RewriteRule ^/([a-zA-Z])/([0-9])/b([0-9])$   category.php?id=$2  [QSA,L]这样写,不对?怎么写这个呢?

解决方案 »

  1.   

    RewriteRule ^/([a-zA-Z]+)/([0-9]+)/b([0-9])$ category.php?id=$2 [QSA,L]加上数量修饰
      

  2.   

    RewriteRule ^/shengridangao/(.*)([0-9]+)(.*)\.html$                          /category.php?id=$1  [QSA,L]原先的是这个,没问题现在url规则改成 /ShengRiDanGao/32/b0   rewirte  这里,怎么写,都想不明白会出错!!!
      

  3.   

    不明白你这里写的/category.phpRewriteRule ^/shengridangao/(.*)([0-9]+)(.*)\.html$ /category.php?id=$1 [QSA,L]而你给出的却是category.php,少了一个目录的分割符号RewriteRule ^/([a-zA-Z]+)/([0-9]+)/b([0-9])$ category.php?id=$2 [QSA,L]
      

  4.   

    谢谢,解决了apache下
    RewriteRule ^([a-zA-Z]+)/([0-9]+)$  category.php?id=$2 [QSA,L]Nginx下
    rewrite     "^/([a-zA-Z]+)/([0-9]+)$"  /category.php?id=$2 last;不明白为什么apaache 加“/” 不行,而nginx 下必须加?