请问代表任意的目录怎么写?我的products下边有一个showdetail.php,显示产品时的地址是
http://www.***.com/products/showdetail.php?id=***;
想改为每一个产品都要有一个自已的目录,类似于
http://www.***.com/products/newproducts/index.html
http://www.***.com/products/newproducts1/index.html
http://www.***.com/products/newproducts2/index.html
http://www.***.com/products/newproducts3/index.html

解决方案 »

  1.   

    1, 请使用Php脚本做页面静态化和静态化页面的呈现,而不是为它们创建一堆目录,创建了没有超链接指向它们,就算你指向了,谁知道静态化页面还在不在?2, 如果是希望重写:<IfModule mod_rewrite.c>
       RewriteEngine On
       RewriteRule ^/products/newproducts(\d*)/index.html$ /products/showdetail.php?id=$1 [L]
    </IfModule>
      

  2.   

    <IfModule mod_rewrite.c>
      RewriteEngine On
      RewriteRule ^/products/newproducts(\d*)/index.html$ /products/showdetail.php?id=$1 [L]
    </IfModule>newproducts是根据不同产品显示不同的文件夹,类似于。http://www.***.com/products/outdoor/index.html
    http://www.***.com/products/indoor/index.html
    http://www.***.com/products/customized/index.html
    http://www.***.com/products/gridled/index.html
      

  3.   

    RewriteRule ^/products/newproducts(\d*)(动态生成文件夹)/index.html$
      

  4.   

    /products/new-products/13.htmlRewriteRule ^/products/(\w*)/index.html$ /products/showdetail.php?id=$1像上边这样写怎么是错误的呢?
      

  5.   

    \w不能匹配 - ,而new-products里面就有-
    郑州PHP.Net
    http://www.zzphp.net/