rewrite问题,找不到网页.

2016-07-07 15:23 来源:www.chinab4c.com 作者:ecshop专家

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

我的规则如下,独立站点,自己的服务器.
  1. [ISAPI_Rewrite]
  2. # 3600 = 1 hour
  3. CacheClockRate 3600
  4. RepeatLimit 32
  5. # Protect httpd.ini and httpd.parse.errors files
  6. # from accessing through HTTP
  7. # 为了确保重写规则不影响服务器上的其他站点
  8. # 请将下面的语句前的#号去掉,并将(?:www\.)?site1\.com改为商店所在域名
  9. #RewriteCond %{HTTP:Host} (?:www\.)?site1\.com
  10. RewriteRule ^(.*)/index.html$ $1/index.php [I]
  11. RewriteRule ^(.*)/category$$1/index.php [I]
  12. RewriteRule ^(.*)/feed-c([0-9]+).xml$$1/feed.php?cat=$2 [I]
  13. RewriteRule ^(.*)/feed-b([0-9]+).xml$$1/feed.php?brand=$2[I]
  14. RewriteRule ^(.*)/feed.xml$$1/feed.php[I]
  15. 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]
  16. 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]
  17. 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]
  18. RewriteRule ^(.*)/category-([0-9]+)-b([0-9]+)-([0-9]+)(.*)\.html$ $1/category.php?id=$2&brand=$3&page=$4[I]
  19. RewriteRule ^(.*)/category-([0-9]+)-b([0-9]+)(.*)\.html$$1/category.php?id=$2&brand=$3 [I]
  20. RewriteRule ^(.*)/category-([0-9]+)(.*)\.html$$1/category.php?id=$2[I]
  21. RewriteRule ^(.*)/goods-([0-9]+)(.*)\.html$ $1/goods.php?id=$2[I]
  22. RewriteRule ^(.*)/article_cat-([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$$1/article_cat.php?id=$2&page=$3&sort=$4&order=$5[I]
  23. RewriteRule ^(.*)/article_cat-([0-9]+)-([0-9]+)(.*)\.html$ $1/article_cat.php?id=$2&page=$3 [I]
  24. RewriteRule ^(.*)/article_cat-([0-9]+)(.*)\.html$ $1/article_cat.php?id=$2[I]
  25. RewriteRule ^(.*)/article-([0-9]+)(.*)\.html$$1/article.php?id=$2 [I]
  26. 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]
  27. RewriteRule ^(.*)/brand-([0-9]+)-c([0-9]+)-([0-9]+)(.*)\.html $1/brand.php?id=$2&cat=$3&page=$4[I]
  28. RewriteRule ^(.*)/brand-([0-9]+)-c([0-9]+)(.*)\.html $1/brand.php?id=$2&cat=$3[I]
  29. RewriteRule ^(.*)/brand-([0-9]+)(.*)\.html$1/brand.php?id=$2[I]
  30. RewriteRule ^(.*)/tag-(.*)\.html$1/search.php?keywords=$2[I]
  31. RewriteRule ^(.*)/snatch-([0-9]+)\.html$$1/snatch.php?id=$2[I]
  32. RewriteRule ^(.*)/group_buy-([0-9]+)\.html$$1/group_buy.php?act=view&id=$2[I]
复制代码
谢谢.


回答:
修改为下面的rewrite 规则即可

  1. RewriteRule ^(.*)/index.html[DISCUZ_CODE_0]nbsp;$1/index\.php\ [I]
  2. RewriteRule ^(.*)/category[DISCUZ_CODE_0]nbsp;$1/index\.php\ [I]
  3. RewriteRule ^(.*)/feed-c([0-9]+).xml[DISCUZ_CODE_0]nbsp; $1/feed\.php\?cat=$2 [I]
  4. RewriteRule ^(.*)/feed-b([0-9]+).xml[DISCUZ_CODE_0]nbsp; $1/feed\.php\?brand=$2[I]
  5. RewriteRule ^(.*)/feed.xml[DISCUZ_CODE_0]nbsp;$1/feed\.php\[I]
  6. 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]
  7. 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]
  8. 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]
  9. RewriteRule ^(.*)/category-([0-9]+)-b([0-9]+)-([0-9]+)(.*)\.html[DISCUZ_CODE_0]nbsp;$1/category\.php\?id=$2&brand=$3&page=$4[I]
  10. RewriteRule ^(.*)/category-([0-9]+)-b([0-9]+)(.*)\.html[DISCUZ_CODE_0]nbsp; $1/category\.php\?id=$2&brand=$3 [I]
  11. RewriteRule ^(.*)/category-([0-9]+)(.*)\.html[DISCUZ_CODE_0]nbsp;$1/category\.php\?id=$2[I]
  12. RewriteRule ^(.*)/goods-([0-9]+)(.*)\.html[DISCUZ_CODE_0]nbsp;$1/goods\.php\?id=$2[I]
  13. 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]
  14. RewriteRule ^(.*)/article_cat-([0-9]+)-([0-9]+)(.*)\.html[DISCUZ_CODE_0]nbsp;$1/article_cat\.php\?id=$2&page=$3 [I]
  15. RewriteRule ^(.*)/article_cat-([0-9]+)(.*)\.html[DISCUZ_CODE_0]nbsp;$1/article_cat\.php\?id=$2[I]
  16. RewriteRule ^(.*)/article-([0-9]+)(.*)\.html[DISCUZ_CODE_0]nbsp; $1/article\.php\?id=$2[I]
  17. 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]
  18. RewriteRule ^(.*)/brand-([0-9]+)-c([0-9]+)-([0-9]+)(.*)\.html $1/brand\.php\?id=$2&cat=$3&page=$4[I]
  19. RewriteRule ^(.*)/brand-([0-9]+)-c([0-9]+)(.*)\.html $1/brand\.php\?id=$2&cat=$3[I]
  20. RewriteRule ^(.*)/brand-([0-9]+)(.*)\.html$1/brand\.php\?id=$2[I]
  21. RewriteRule ^(.*)/tag-(.*)\.html$1/search\.php\?keywords=$2[I]
  22. RewriteRule ^(.*)/snatch-([0-9]+)\.html[DISCUZ_CODE_0]nbsp; $1/snatch\.php\?id=$2[I]
  23. RewriteRule ^(.*)/group_buy-([0-9]+)\.html[DISCUZ_CODE_0]nbsp; $1/group_buy\.php\?act=view&id=$2[I]
复制代码

httpd.ini.zip (761 Bytes)

Win2003IIS Rewrite for ec2.5.0


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

原帖由 kkey0416 于 2008-1-7 01:43 发表
谢谢.解决了.郁闷.官方的里面多了个$?


不是
是win的主机需要写成 xxxx\.php\?xxx这样的格式

此方法为管理员推荐方法,其实用此法后产品分类列表上部的排序及显示方式都无法使用的。

终于找到解决方法,非常感谢大猪。

怎样开启伪静态呢伪静态

7# 恒星科技
商店的设置可以开启 url重写

我试了也是不行,要疯了啊

,我的一直没成功啊啊啊