ecshop2.7.2完全静态化方案V1.1

2016-07-07 14:55 来源:www.chinab4c.com 作者:ecshop专家

这个真的是太棒了 。

回答:
静态化 很重要的说

坚决顶起来,这个很实用
一直在期待官方出方案来着
~~

和系统自动的重写有什么区别

支持下,虽然还不明白

感谢了测试一下,希望能用,那就太棒了

更新了一下下载包,更正了一些错误。
1、底部系统执行信息改为动态显示。
2、修改了文章列表搜索静态化无法使用的错误。
3、修改了goods.php页面ajax调用返回的一个错误。

这个插件我也有,,没想共享出来了



httpd.conf版本

  1. <IfModule mod_rewrite.c>
  2. RewriteEngine On

  3. RewriteRule ^(.*)/$$1/index.html [L,R]
  4. RewriteRule ^(.*)/category$$1/index.html [L,R]
  5. RewriteRule ^(.*)/message.html$$1/message-1.html [L,R]

  6. RewriteCond %{REQUEST_FILENAME} index.html$ [OR]
  7. RewriteCond %{REQUEST_FILENAME} snatch.html$ [OR]
  8. RewriteCond %{REQUEST_FILENAME} group_buy.html$ [OR]
  9. RewriteCond %{REQUEST_FILENAME} auction.html$ [OR]
  10. RewriteCond %{REQUEST_FILENAME} exchange.html$ [OR]
  11. RewriteCond %{REQUEST_FILENAME} activity.html$ [OR]
  12. #RewriteCond %{REQUEST_FILENAME} feed-c([0-9]+).xml$ [OR]
  13. #RewriteCond %{REQUEST_FILENAME} feed-b([0-9]+).xml$ [OR]
  14. #RewriteCond %{REQUEST_FILENAME} feed-type([^-]+)\.xml$ [OR]
  15. #RewriteCond %{REQUEST_FILENAME} feed.xml$ [OR]
  16. RewriteCond %{REQUEST_FILENAME} category-([0-9]+)-b([0-9]+)-min([0-9]+)-max([0-9]+)-attr([^-]*)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$ [OR]
  17. RewriteCond %{REQUEST_FILENAME} category-([0-9]+)-b([0-9]+)-min([0-9]+)-max([0-9]+)-attr([^-]*)(.*)\.html$ [OR]
  18. RewriteCond %{REQUEST_FILENAME} category-([0-9]+)-b([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$ [OR]
  19. RewriteCond %{REQUEST_FILENAME} category-([0-9]+)-b([0-9]+)-([0-9]+)(.*)\.html$ [OR]
  20. RewriteCond %{REQUEST_FILENAME} category-([0-9]+)-b([0-9]+)(.*)\.html$ [OR]
  21. RewriteCond %{REQUEST_FILENAME} category-([0-9]+)(.*)\.html$ [OR]
  22. RewriteCond %{REQUEST_FILENAME} goods-([0-9]+)(.*)\.html$ [OR]
  23. RewriteCond %{REQUEST_FILENAME} article_cat-([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$ [OR]
  24. RewriteCond %{REQUEST_FILENAME} article_cat-([0-9]+)-([0-9]+)-(.+)(.*)\.html$ [OR]
  25. RewriteCond %{REQUEST_FILENAME} article_cat-([0-9]+)-([0-9]+)(.*)\.html$ [OR]
  26. RewriteCond %{REQUEST_FILENAME} article_cat-([0-9]+)(.*)\.html$ [OR]
  27. RewriteCond %{REQUEST_FILENAME} article-([0-9]+)(.*)\.html$ [OR]
  28. RewriteCond %{REQUEST_FILENAME} brand-([0-9]+)-c([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)\.html [OR]
  29. RewriteCond %{REQUEST_FILENAME} brand-([0-9]+)-c([0-9]+)-([0-9]+)(.*)\.html [OR]
  30. RewriteCond %{REQUEST_FILENAME} brand-([0-9]+)-c([0-9]+)(.*)\.html [OR]
  31. RewriteCond %{REQUEST_FILENAME} brand-([0-9]+)(.*)\.html [OR]
  32. #RewriteCond %{REQUEST_FILENAME} tag-(.*)\.html [OR]
  33. #RewriteCond %{REQUEST_FILENAME} snatch-([0-9]+)\.html$ [OR]
  34. RewriteCond %{REQUEST_FILENAME} group_buy-([0-9]+)\.html$ [OR]
  35. #RewriteCond %{REQUEST_FILENAME} auction-([0-9]+)\.html$ [OR]
  36. RewriteCond %{REQUEST_FILENAME} exchange-id([0-9]+)(.*)\.html$ [OR]
  37. RewriteCond %{REQUEST_FILENAME} exchange-([0-9]+)-min([0-9]+)-max([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$ [OR]
  38. RewriteCond %{REQUEST_FILENAME} exchange-([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$ [OR]
  39. RewriteCond %{REQUEST_FILENAME} exchange-([0-9]+)-([0-9]+)(.*)\.html$ [OR]
  40. RewriteCond %{REQUEST_FILENAME} exchange-([0-9]+)(.*)\.html$ [OR]
  41. RewriteCond %{REQUEST_FILENAME} message-([0-9]+)(.*)\.html$
  42. RewriteCond %{DOCUMENT_ROOT}/html/%{REQUEST_FILENAME} -f
  43. RewriteRule ^/(.+) /html/$1 [L]

  44. RewriteRule ^(.*)/index.html$ $1/index.php[L]
  45. RewriteRule ^(.*)/snatch.html$$1/snatch.php [L]
  46. RewriteRule ^(.*)/group_buy.html$$1/group_buy.php [L]
  47. RewriteRule ^(.*)/auction.html$$1/auction.php[L]
  48. RewriteRule ^(.*)/exchange.html$ $1/exchange.php[L]
  49. RewriteRule ^(.*)/activity.html$ $1/activity.php[L]
  50. RewriteRule ^(.*)/feed-c([0-9]+).xml$$1/feed.php?cat=$2[L]
  51. RewriteRule ^(.*)/feed-b([0-9]+).xml$$1/feed.php?brand=$2[L]
  52. RewriteRule ^(.*)/feed-type([^-]+)\.xml$$1/feed\.php\?type=$2[L]
  53. RewriteRule ^(.*)/feed.xml$$1/feed.php[L]
  54. 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 [QSA,L]
  55. 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 [QSA,L]
  56. 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 [QSA,L]
  57. RewriteRule ^(.*)/category-([0-9]+)-b([0-9]+)-([0-9]+)(.*)\.html$$1/category.php?id=$2&brand=$3&page=$4 [QSA,L]
  58. RewriteRule ^(.*)/category-([0-9]+)-b([0-9]+)(.*)\.html$$1/category.php?id=$2&brand=$3 [QSA,L]
  59. RewriteRule ^(.*)/category-([0-9]+)(.*)\.html$ $1/category.php?id=$2 [QSA,L]
  60. RewriteRule ^(.*)/goods-([0-9]+)(.*)\.html$ $1/goods.php?id=$2 [QSA,L]
  61. RewriteRule ^(.*)/article_cat-([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$$1/article_cat.php?id=$2&page=$3&sort=$4&order=$5 [QSA,L]
  62. RewriteRule ^(.*)/article_cat-([0-9]+)-([0-9]+)-(.+)(.*)\.html$$1/article_cat\.php\?id=$1&page=$2&keywords=$3 [QSA,L]
  63. RewriteRule ^(.*)/article_cat-([0-9]+)-([0-9]+)(.*)\.html$ $1/article_cat.php?id=$2&page=$3 [QSA,L]
  64. RewriteRule ^(.*)/article_cat-([0-9]+)(.*)\.html$ $1/article_cat.php?id=$2 [QSA,L]
  65. RewriteRule ^(.*)/article-([0-9]+)(.*)\.html$$1/article.php?id=$2 [QSA,L]
  66. 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 [QSA,L]
  67. RewriteRule ^(.*)/brand-([0-9]+)-c([0-9]+)-([0-9]+)(.*)\.html $1/brand.php?id=$2&cat=$3&page=$4 [QSA,L]
  68. RewriteRule ^(.*)/brand-([0-9]+)-c([0-9]+)(.*)\.html $1/brand.php?id=$2&cat=$3 [QSA,L]
  69. RewriteRule ^(.*)/brand-([0-9]+)(.*)\.html$1/brand.php?id=$2 [QSA,L]
  70. RewriteRule ^(.*)/tag-(.*)\.html$1/search.php?keywords=$2&notstatic=1 [QSA,L]
  71. RewriteRule ^(.*)/snatch-([0-9]+)\.html$ $1/snatch.php?id=$2&notstatic=1 [QSA,L]
  72. RewriteRule ^(.*)/group_buy-([0-9]+)\.html$ $1/group_buy.php?act=view&id=$2 [QSA,L]
  73. RewriteRule ^(.*)/auction-([0-9]+)\.html$$1/auction.php?act=view&id=$2&notstatic=1 [QSA,L]
  74. RewriteRule ^(.*)/exchange-id([0-9]+)(.*)\.html$$1/exchange\.php\?id=$2&act=view [QSA,L]
  75. 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 [QSA,L]
  76. RewriteRule ^(.*)/exchange-([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$ $1/exchange\.php\?cat_id=$2&page=$3&sort=$4&order=$5 [QSA,L]
  77. RewriteRule ^(.*)/exchange-([0-9]+)-([0-9]+)(.*)\.html$$1/exchange\.php\?cat_id=$2&page=$3[QSA,L]
  78. RewriteRule ^(.*)/exchange-([0-9]+)(.*)\.html$$1/exchange\.php\?cat_id=$2[QSA,L]
  79. RewriteRule ^(.*)/message-([0-9]+)(.*)\.html$$1/message.php?id=$2 [QSA,L]
  80. </IfModule>
复制代码



插件很难解决问题,因为网页上的有些东西是没办法完全静态化的,比如用户登录信息、购物车信息、浏览历史等,所以最后还是要去修改原始程序,把不能静态化的部分提出来,单独处理。此外,还有其它很多问题。这些问题都是ecshop在做真正静态化没有考虑到的。要真正解决问题,还是要修改原代码。



请教几个问题,谢谢:

1、之前的收录有动态的收录的页面,简单重写收录的页面,以及复杂重写收录的页面,做了这个完全静态功能后,能自动跳转到这个纯静态页面吗。

2、如果文章有分页,文章分页能正常静态吗?