本帖最后由 szgekko 于 2009-7-29 10:46 编辑 [ISAPI_Rewrite]
RewriteRule ^(.*)/index.html$                $1/index\.php RewriteRule ^(.*)/Product_state_([0-9]+)\.html$ $1/index\.php\?action=Product&state=$2
上面是我的httpd.ini文件
现在有这2条规则
一个是想  访问  index.html即可访问
一个是想访问
Product_state_1.html  等同于 index.php?action=Product&state=1请问这样写法有问题吗!? 
先不看第2条的话
我现在
[ISAPI_Rewrite]
RewriteRule ^(.*)/index.html$                $1/index\.php 只有这一条 也不能通过
index.html 访问首页呢……请大家纠正错误 多谢

解决方案 »

  1.   

    RewriteRule ^(.*)/index.html$                $1/index.php [L,QSA]
    RewriteRule ^(.*)/Product_state_([0-9]+).html$ $1/index.php?action=Product&state=$2 [L,QSA] 
      

  2.   

    RewriteRule ^/index.html$ /index.php [L]
    RewriteRule ^/Product_state_([0-9]+).html$ /index.php?action=Product&state=$1 [L]
      

  3.   

    isapi2.0和3.0的写法有差别,如果楼主用2.0的话,很多参数都是不支持的(比如很方便的-f,-d什么的……)
    不过还好,简单的转向,2.0和3.0基本是通用的,只是2.0里url的问号部分要加上转义符
    以下规则在isapi2.0里调试通过,如果需要3.0的话,好像有工具可以直接进行代码转换的[ISAPI_Rewrite]
    RewriteRule ^/Product_state_(.*).htm$ /index.php\?action=Product&state=$1
    RewriteRule ^/index.htm$ /index.php [I,L]