我想用 /productname_p16.html 访问 /product_detail.php?id=16
我的规则:
RewriteRule /(.*)_p(\d+).html /product_detail.php\?id=$2搞了半天,还是不对啊到底哪里错了,大家帮我看看
谢谢了

解决方案 »

  1.   

    RewriteRule /productname_p([0-9]+).html /product_detail.php?id=$1试试 
      

  2.   

    我如果去掉后面的.html,就是对的
    你写的和我写的都是正确的
    加了那个.html,我再在网址后面加.html,就不行了
    非常奇怪
      

  3.   

    给你写一个吧我想用 /productname_p16.html 访问 /product_detail.php?id=16 
    在httpd:RewriteRule ^/productname_p([0-9]+)\.html$ /product_detail.php?id=$2  [L]在.htaccess中RewriteRule ^productname_p([0-9]+)\.html$ /product_detail.php?id=$2  [L]\d在早期版本不支持, 后面部分的路径不要转义:?http://www.zzxj.net/blog/fxs_2008/archive/2009/01/20/11.html
      

  4.   

    RewriteRule ^/productname_p([0-9]+)\.html$ /product_detail.php?id=$1  [L]在.htaccess中RewriteRule ^productname_p([0-9]+)\.html$ /product_detail.php?id=$1  [L]