iestore.cniestore在linux环境下通过.htaccess默认实现了静态网址映射,# URL rewriting module activation
RewriteEngine on# URL rewriting rules
RewriteRule ^A-([0-9]+)\-([a-zA-Z0-9-]*)\-A\.html$ article.php?aid=$1 [L,E]
RewriteRule ^AC-([0-9]+)\-([a-zA-Z0-9-]*)\-AC\.html$ article.php?id_category=$1 [L,E]
RewriteRule ^([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ product.php?id_product=$1$3 [L,E]
RewriteRule ^([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ category.php?id_category=$1 [QSA,L,E]
RewriteRule ^([0-9]+)__([a-zA-Z0-9-]*)(.*)$ supplier.php?id_supplier=$1$3 [QSA,L,E]
RewriteRule ^([0-9]+)_([a-zA-Z0-9-]*)(.*)$ manufacturer.php?id_manufacturer=$1$3 [QSA,L,E]# Catch 404 errors
ErrorDocument 404 /404.php
产品类别倒是有映射成类似 http://www.abc.com/21-category-name 的形式,
但是产品页面却映射成类似 http://www.abc.com/896-896.html 的形式,
怎样把产品页面也映射成类似 http://www.abc.com/21-product-name 的形式呢?
我把上面的 RewriteRule ^([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ product.php?id_product=$1$3 [L,E] 改为
RewriteRule ^([0-9]+)\-([a-zA-Z0-9-]*)\(.*)$ product.php?id_product=$1$3 [QSA,L,E] 也没用。
我现在还找不到控制的代码在哪里。
有哪位大侠知道要怎么做吗?

解决方案 »

  1.   

    你贴的RewriteRule是将静态的html映射到php页面去啊,这个和你的要求矛盾啊。
    你改的规则语法不正确,根本不能执行请举例说明你想把什么映射成什么。
      

  2.   

    是把 php 页面映射为 html  或不带后缀的 网址!
      

  3.   


    RewriteRule ^([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ category.php?id_category=$1 [QSA,L,E]
    它这个语句是把后面的映射成前面的哦!
    这个已经验证过,没问题。可以把http://www.abc.com/category.php?id_category=21 映射成
    http://www.abc.com/21-category-name