我的没什么问题的urlrewrite

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

我以前的rss订阅里面的文章不能访问,还有商品分类里的价格排序不对,后来修改了下可以了,整个文件如下
# Helicon ISAPI_Rewrite configuration file
# Version 3.1.0.60

RewriteEngine On
RewriteCompatibility2 On
RepeatLimit 200
RewriteBase
# unsupported directive: [ISAPI_Rewrite]

# RewriteCond %{HTTP:Host} (?:www\.)?site1\.com

# RewriteCond %{{HTTP:Host}} ^www.i123.cn$
RewriteCond %{HTTP:Host} (?:www\.)?i123\.cn
RewriteRule ^(.*)/index.html$ $1/index\.php [NC]
RewriteRule ^(.*)/category$ $1/index\.php [NC]
RewriteRule ^(.*)/feed-c([0-9]+).xml$ $1/feed\.php\?cat=$2 [NC]
RewriteRule ^(.*)/feed-b([0-9]+).xml$ $1/feed\.php\?brand=$2 [NC]
RewriteRule ^(.*)/feed.xml$ $1/feed\.php [NC]
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[NC]
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[NC]
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[NC]
RewriteRule ^(.*)/category-([0-9]+)-b([0-9]+)-([0-9]+)(.*)\.html$ $1/category\.php\?id=$2&brand=$3&page=$4 [NC]
RewriteRule ^(.*)/category-([0-9]+)-b([0-9]+)(.*)\.html$ $1/category\.php\?id=$2&brand=$3 [NC]
RewriteRule ^(.*)/category-([0-9]+)(.*)\.html$ $1/category\.php\?id=$2 [NC]
#RewriteRule ^(.*)/category-([0-9]+)-b([0-9]+)\.html(.*)$ $1/category\.php\?$4&id=$2&brand=$3 [NC]
RewriteRule ^(.*)/category-([0-9]+)-b([0-9]+)\.html(.*)$ $1/category\.php$4 [NC]
RewriteRule ^(.*)/goods-([0-9]+)(.*)\.html(.*)$ $1/goods\.php\?id=$2 [NC]
RewriteRule ^(.*)/goods-([0-9]+)(.*)\.html$ $1/goods\.php\?id=$2 [NC]
RewriteRule^(.*)/article_cat-([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$$1/article_cat\.php\?id=$2&page=$3&sort=$4&order=$5 [NC]
RewriteRule ^(.*)/article_cat-([0-9]+)-([0-9]+)(.*)\.html$ $1/article_cat\.php\?id=$2&page=$3 [NC]
RewriteRule ^(.*)/article_cat-([0-9]+)(.*)\.html$ $1/article_cat\.php\?id=$2 [NC]
RewriteRule ^(.*)/article-([0-9]+)(.*)\.html$ $1/article\.php\?id=$2 [NC]
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[NC]
RewriteRule ^(.*)/brand-([0-9]+)-c([0-9]+)-([0-9]+)(.*)\.html$ $1/brand\.php\?id=$2&cat=$3&page=$4 [NC]

RewriteRule ^(.*)/brand-([0-9]+)-c([0-9]+)\.html(.*)$ $1/brand\.php\?$4&id=$2&cat=$3 [NC]

RewriteRule ^(.*)/brand-([0-9]+)-c([0-9]+)(.*)\.html$ $1/brand\.php\?id=$2&cat=$3 [NC]
RewriteRule ^(.*)/brand-([0-9]+)(.*)\.html$ $1/brand\.php\?id=$2 [NC]
RewriteRule ^(.*)/tag-(.*)\.html$ $1/search\.php\?keywords=$2 [NC]
RewriteRule ^(.*)/snatch-([0-9]+)\.html$ $1/snatch\.php\?id=$2 [NC]
RewriteRule ^(.*)/group_buy-([0-9]+)\.html$ $1/group_buy\.php\?act=view&id=$2 [NC]
RewriteRule ^(.*)/auction-([0-9]+)\.html$ $1/auction\.php\?act=view&id=$2 [NC]
RewriteRule ^(.*)/exchange-id([0-9]+)(.*)\.html$ $1/exchange\.php\?id=$2&act=view [NC]
RewriteRule^(.*)/exchange-([0-9]+)-min([0-9]+)-max([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$$1/exchange\.php\?cat_id=$2&integral_min=$3&integral_max=$4&page=$5&sort=$6&order=$7[NC]
RewriteRule^(.*)/exchange-([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$$1/exchange\.php\?cat_id=$2&page=$3&sort=$4&order=$5 [NC]
RewriteRule ^(.*)/exchange-([0-9]+)-([0-9]+)(.*)\.html$ $1/exchange\.php\?cat_id=$2&page=$3 [NC]
RewriteRule ^(.*)/exchange-([0-9]+)(.*)\.html$ $1/exchange\.php\?cat_id=$2 [NC]

回答:
收藏了...謝謝....
http://www.pingdong.com.tw

感谢分享。

今天发现还有问题,就是只能在第一页排序,到第二页再用价格排序就出问题,谁有时间再改下

收藏了 :)



我修改了下,主要是我下面这些类型的出问题
http://www.i123.cn/goods-12445.html?from=rss

http://www.i123.cn/category-186- ... filter_attr=&page=2

我的http.ini如下:(以后再发现问题再修改)
  1. [ISAPI_Rewrite]



  2. RewriteCond %{HTTP:Host} (?:www\.)?i123\.cn



  3. RewriteRule ^(.*)/index.html$ $1/index\.php [I]

  4. RewriteRule ^(.*)/category$$1/index\.php [I]

  5. RewriteRule ^(.*)/feed-c([0-9]+).xml$$1/feed\.php\?cat=$2 [I]

  6. RewriteRule ^(.*)/feed-b([0-9]+).xml$$1/feed\.php\?brand=$2[I]

  7. RewriteRule ^(.*)/feed.xml$$1/feed\.php[I]

  8. 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]

  9. 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]

  10. 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]

  11. RewriteRule ^(.*)/category-([0-9]+)-b([0-9]+)-([0-9]+)(.*)\.html$$1/category\.php\?id=$2&brand=$3&page=$4[I]

  12. RewriteRule ^(.*)/category-([0-9]+)-b([0-9]+)(.*)\.html$$1/category\.php\?id=$2&brand=$3 [I]

  13. RewriteRule ^(.*)/category-([0-9]+)-b([0-9]+)(.*)\.html(.*)$$1/category\.php$5[I]

  14. RewriteRule ^(.*)/category-([0-9]+)(.*)\.html$ $1/category\.php\?id=$2[I]



  15. RewriteRule ^(.*)/category-([0-9]+)-b([0-9]+)\.html(.*)$$1/category\.php\?$4&id=$2&brand=$3[I]





  16. RewriteRule ^(.*)/goods-([0-9]+)(.*)\.html$ $1/goods\.php\?id=$2[I]

  17. RewriteRule ^(.*)/goods-([0-9]+)(.*)\.html(.*)$ $1/goods\.php\?id=$2[I]

  18. RewriteRule ^(.*)/article_cat-([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$$1/article_cat\.php\?id=$2&page=$3&sort=$4&order=$5[I]

  19. RewriteRule ^(.*)/article_cat-([0-9]+)-([0-9]+)(.*)\.html$ $1/article_cat\.php\?id=$2&page=$3 [I]

  20. RewriteRule ^(.*)/article_cat-([0-9]+)(.*)\.html$ $1/article_cat\.php\?id=$2[I]

  21. RewriteRule ^(.*)/article-([0-9]+)(.*)\.html$$1/article\.php\?id=$2 [I]

  22. 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]

  23. RewriteRule ^(.*)/brand-([0-9]+)-c([0-9]+)-([0-9]+)(.*)\.html $1/brand\.php\?id=$2&cat=$3&page=$4[I]



  24. RewriteRule ^(.*)/brand-([0-9]+)-c([0-9]+)\.html(.*)$$1/brand\.php\?$4&id=$2&cat=$3[I]



  25. RewriteRule ^(.*)/brand-([0-9]+)-c([0-9]+)(.*)\.html $1/brand\.php\?id=$2&cat=$3[I]

  26. RewriteRule ^(.*)/brand-([0-9]+)(.*)\.html$1/brand\.php\?id=$2[I]

  27. RewriteRule ^(.*)/tag-(.*)\.html$1/search\.php\?keywords=$2[I]

  28. RewriteRule ^(.*)/snatch-([0-9]+)\.html$ $1/snatch\.php\?id=$2[I]

  29. RewriteRule ^(.*)/group_buy-([0-9]+)\.html$ $1/group_buy\.php\?act=view&id=$2[I]

  30. RewriteRule ^(.*)/auction-([0-9]+)\.html$$1/auction\.php\?act=view&id=$2 [I]

  31. RewriteRule ^(.*)/exchange-id([0-9]+)(.*)\.html$$1/exchange\.php\?id=$2&act=view[I]

  32. RewriteRule ^(.*)/exchange-([0-9]+)-min([0-9]+)-max([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$ $1/exchange\.php\?cat_id=$2&integral_min=$3&integral_max=$4&page=$5&sort=$6&order=$7 [I]

  33. RewriteRule ^(.*)/exchange-([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$ $1/exchange\.php\?cat_id=$2&page=$3&sort=$4&order=$5 [I]

  34. RewriteRule ^(.*)/exchange-([0-9]+)-([0-9]+)(.*)\.html$$1/exchange\.php\?cat_id=$2&page=$3[I]

  35. RewriteRule ^(.*)/exchange-([0-9]+)(.*)\.html$$1/exchange\.php\?cat_id=$2[I]
复制代码

不过我觉得以后 把那个排序的那个go按钮直接改掉更好,不要在.html后接变量