发新话题
打印

[已解决] rewrite问题,找不到网页.

rewrite问题,找不到网页.

请教规则该如何写?只有index.html可以访问.http://www.8shop.com.cn,搜索了整个论坛都解决不了.
服务器为win2003+iis6.

我的规则如下,独立站点,自己的服务器.
复制内容到剪贴板
代码:
[ISAPI_Rewrite]
# 3600 = 1 hour
CacheClockRate 3600
RepeatLimit 32
# Protect httpd.ini and httpd.parse.errors files
# from accessing through HTTP
# 为了确保重写规则不影响服务器上的其他站点
# 请将下面的语句前的#号去掉,并将(?:www\.)?site1\.com改为商店所在域名
#RewriteCond %{HTTP:Host} (?:www\.)?site1\.com
RewriteRule ^(.*)/index.html$                $1/index.php          [I]                     
RewriteRule ^(.*)/category$                  $1/index.php          [I]
RewriteRule ^(.*)/feed-c([0-9]+).xml$        $1/feed.php?cat=$2    [I]
RewriteRule ^(.*)/feed-b([0-9]+).xml$        $1/feed.php?brand=$2  [I]
RewriteRule ^(.*)/feed.xml$                  $1/feed.php           [I]
RewriteRule ^(.*)/category-([0-9]+)-b([0-9]+)-min([0-9]+)-max([0-9]+)-attr([^-]*)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$ $1/category.php?id=$2&brand=$3&price_min=$4&price_max=$5&filter_attr=$6&page=$7&sort=$8&order=$9 [I]
RewriteRule ^(.*)/category-([0-9]+)-b([0-9]+)-min([0-9]+)-max([0-9]+)-attr([^-]*)\.html$                         $1/category.php?id=$2&brand=$3&price_min=$4&price_max=$5&filter_attr=$6                          [I]
RewriteRule ^(.*)/category-([0-9]+)-b([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$                          $1/category.php?id=$2&brand=$3&page=$4&sort=$5&order=$6                                          [I]
RewriteRule ^(.*)/category-([0-9]+)-b([0-9]+)-([0-9]+)(.*)\.html$                            $1/category.php?id=$2&brand=$3&page=$4                                                           [I]
RewriteRule ^(.*)/category-([0-9]+)-b([0-9]+)(.*)\.html$                             $1/category.php?id=$2&brand=$3                                                                   [I]
RewriteRule ^(.*)/category-([0-9]+)(.*)\.html$                              $1/category.php?id=$2                              [I]
RewriteRule ^(.*)/goods-([0-9]+)(.*)\.html$                                  $1/goods.php?id=$2                                 [I]  
RewriteRule ^(.*)/article_cat-([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$  $1/article_cat.php?id=$2&page=$3&sort=$4&order=$5  [I]
RewriteRule ^(.*)/article_cat-([0-9]+)-([0-9]+)(.*)\.html$                   $1/article_cat.php?id=$2&page=$3                   [I]
RewriteRule ^(.*)/article_cat-([0-9]+)(.*)\.html$                            $1/article_cat.php?id=$2                           [I]
RewriteRule ^(.*)/article-([0-9]+)(.*)\.html$                                $1/article.php?id=$2                               [I]
RewriteRule ^(.*)/brand-([0-9]+)-c([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)\.html   $1/brand.php?id=$2&cat=$3&page=$4&sort=$5&order=$6 [I]
RewriteRule ^(.*)/brand-([0-9]+)-c([0-9]+)-([0-9]+)(.*)\.html                $1/brand.php?id=$2&cat=$3&page=$4                  [I]
RewriteRule ^(.*)/brand-([0-9]+)-c([0-9]+)(.*)\.html                         $1/brand.php?id=$2&cat=$3                          [I]
RewriteRule ^(.*)/brand-([0-9]+)(.*)\.html                                   $1/brand.php?id=$2                                 [I]
RewriteRule ^(.*)/tag-(.*)\.html                                             $1/search.php?keywords=$2                          [I]
RewriteRule ^(.*)/snatch-([0-9]+)\.html$                                      $1/snatch.php?id=$2                                [I]
RewriteRule ^(.*)/group_buy-([0-9]+)\.html$                                   $1/group_buy.php?act=view&id=$2                    [I]
谢谢.

[ 本帖最后由 kkey0416 于 2008-1-7 01:43 编辑 ]

TOP

修改为下面的rewrite 规则即可
复制内容到剪贴板
代码:
RewriteRule ^(.*)/index.html[        DISCUZ_CODE_0        ]nbsp;               $1/index\.php\          [I]                     
RewriteRule ^(.*)/category[        DISCUZ_CODE_0        ]nbsp;                 $1/index\.php\          [I]
RewriteRule ^(.*)/feed-c([0-9]+).xml[        DISCUZ_CODE_0        ]nbsp;       $1/feed\.php\?cat=$2    [I]
RewriteRule ^(.*)/feed-b([0-9]+).xml[        DISCUZ_CODE_0        ]nbsp;       $1/feed\.php\?brand=$2  [I]
RewriteRule ^(.*)/feed.xml[        DISCUZ_CODE_0        ]nbsp;                 $1/feed\.php\           [I]
RewriteRule ^(.*)/category-([0-9]+)-b([0-9]+)-min([0-9]+)-max([0-9]+)-attr([^-]*)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html[        DISCUZ_CODE_0        ]nbsp;   $1/category\.php\?id=$2&brand=$3&price_min=$4&price_max=$5&filter_attr=$6&page=$7&sort=$8&order=$9 [I]
RewriteRule ^(.*)/category-([0-9]+)-b([0-9]+)-min([0-9]+)-max([0-9]+)-attr([^-]*)\.html[        DISCUZ_CODE_0        ]nbsp;                           $1/category\.php\?id=$2&brand=$3&price_min=$4&price_max=$5&filter_attr=$6                          [I]
RewriteRule ^(.*)/category-([0-9]+)-b([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html[        DISCUZ_CODE_0        ]nbsp;                               $1/category\.php\?id=$2&brand=$3&page=$4&sort=$5&order=$6                                          [I]
RewriteRule ^(.*)/category-([0-9]+)-b([0-9]+)-([0-9]+)(.*)\.html[        DISCUZ_CODE_0        ]nbsp;                                       $1/category\.php\?id=$2&brand=$3&page=$4                                                           [I]
RewriteRule ^(.*)/category-([0-9]+)-b([0-9]+)(.*)\.html[        DISCUZ_CODE_0        ]nbsp;                                           $1/category\.php\?id=$2&brand=$3                                                                   [I]
RewriteRule ^(.*)/category-([0-9]+)(.*)\.html[        DISCUZ_CODE_0        ]nbsp;                                $1/category\.php\?id=$2                              [I]
RewriteRule ^(.*)/goods-([0-9]+)(.*)\.html[        DISCUZ_CODE_0        ]nbsp;                                 $1/goods\.php\?id=$2                                 [I]  
RewriteRule ^(.*)/article_cat-([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html[        DISCUZ_CODE_0        ]nbsp; $1/article_cat\.php\?id=$2&page=$3&sort=$4&order=$5  [I]
RewriteRule ^(.*)/article_cat-([0-9]+)-([0-9]+)(.*)\.html[        DISCUZ_CODE_0        ]nbsp;                  $1/article_cat\.php\?id=$2&page=$3                   [I]
RewriteRule ^(.*)/article_cat-([0-9]+)(.*)\.html[        DISCUZ_CODE_0        ]nbsp;                           $1/article_cat\.php\?id=$2                           [I]
RewriteRule ^(.*)/article-([0-9]+)(.*)\.html[        DISCUZ_CODE_0        ]nbsp;                               $1/article\.php\?id=$2                              [I]
RewriteRule ^(.*)/brand-([0-9]+)-c([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)\.html   $1/brand\.php\?id=$2&cat=$3&page=$4&sort=$5&order=$6 [I]
RewriteRule ^(.*)/brand-([0-9]+)-c([0-9]+)-([0-9]+)(.*)\.html                $1/brand\.php\?id=$2&cat=$3&page=$4                  [I]
RewriteRule ^(.*)/brand-([0-9]+)-c([0-9]+)(.*)\.html                         $1/brand\.php\?id=$2&cat=$3                          [I]
RewriteRule ^(.*)/brand-([0-9]+)(.*)\.html                                   $1/brand\.php\?id=$2                                 [I]
RewriteRule ^(.*)/tag-(.*)\.html                                             $1/search\.php\?keywords=$2                          [I]
RewriteRule ^(.*)/snatch-([0-9]+)\.html[        DISCUZ_CODE_0        ]nbsp;                                     $1/snatch\.php\?id=$2                                [I]
RewriteRule ^(.*)/group_buy-([0-9]+)\.html[        DISCUZ_CODE_0        ]nbsp;                                  $1/group_buy\.php\?act=view&id=$2                    [I]
[ 本帖最后由 大猪 于 2008-1-7 01:41 编辑 ]

附件

httpd.ini.zip (761 Bytes)

2008-1-7 01:41, 下载次数: 166

Win2003IIS Rewrite for ec2.5.0

【ECSHOP 程序·模板·DIY 】 QQ群:5583423
EC留言板插件已发布,需要的请到插件区下载

TOP

谢谢.解决了.郁闷.官方的里面多了个$?

TOP

引用:
原帖由 kkey0416 于 2008-1-7 01:43 发表
谢谢.解决了.郁闷.官方的里面多了个$?
不是
是win的主机需要写成 xxxx\.php\?xxx这样的格式
【ECSHOP 程序·模板·DIY 】 QQ群:5583423
EC留言板插件已发布,需要的请到插件区下载

TOP

发新话题