htaccess 的设置,请教一下

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

其实就是正则了。...呵呵...

回答:
大哥,能说的详细点么?

哪个大哥帮帮我啊 哭

IIS就是麻烦

继续求解!



iis 下不支持 .htaccess 这样的文件
iis下如果支持自定义重写 那一般是用 httpd.ini 这样的文件.

另外由于DZ是很普遍的程序,所以一般空间都已加载,并不是你的.htaccess 在起作用.
将以下代码拷贝,建立文件名为 httpd.ini ,上传到EC目录下即可(只要你空间支持自定义重写)


  1. [ISAPI_Rewrite]
  2. # ECSHOP重写规则,适用于IIS[ISAPI_Rewrite]
  3. RewriteRule /index.html/index.php
  4. RewriteRule /default.html /index.php
  5. RewriteRule /ecshop/feed.xml/ecshop/feed.php
  6. 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
  7. #RewriteRule /ecshop/category-([0-9]+)-b([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$ /ecshop/category.php?id=$1&brand=$2&page=$3&sort=$4&order=$5
  8. 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
  9. #RewriteRule /ecshop/category-([0-9]+)-b([0-9]+)-([0-9]+)(.*)\.html$/ecshop/category.php?id=$1&brand=$2&page=$3
  10. RewriteRule ^(.*)/category-([0-9]+)-b([0-9]+)-([0-9]+)(.*)\.html$$1/category\.php\?id=$2&brand=$3&page=$4
  11. #RewriteRule /ecshop/category-([0-9]+)-b([0-9]+)(.*)\.html$ /ecshop/category.php?id=$1&brand=$2
  12. RewriteRule ^(.*)/category-([0-9]+)-b([0-9]+)(.*)\.html$ $1/category\.php\?id=$2&brand=$3
  13. #RewriteRule /ecshop/category-([0-9]+)(.*)\.html$/ecshop/category.php?id=$1
  14. RewriteRule ^(.*)/category-([0-9]+)(.*)\.html$$1/category\.php\?id=$2
  15. #RewriteRule /ecshop/goods-([0-9]+)(.*)\.html$/ecshop/goods.php?id=$1
  16. RewriteRule ^(.*)/goods-([0-9]+)(.*)\.html$ $1/goods\.php\?id=$2

  17. #RewriteRule /ecshop/article_cat-([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$ /ecshop/article_cat.php?id=$1&page=$2&sort=$3&order=$4
  18. RewriteRule ^(.*)/article_cat-([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$ $1/article_cat\.php\?id=$2&page=$3&sort=$4&order=$5
  19. #RewriteRule /ecshop/article_cat-([0-9]+)-([0-9]+)(.*)\.html$/ecshop/article_cat.php?id=$1&page=$2
  20. RewriteRule ^(.*)/article_cat-([0-9]+)-([0-9]+)(.*)\.html$$1/article_cat\.php\?id=$2&page=$3
  21. #RewriteRule /ecshop/article_cat-([0-9]+)(.*)\.html$ /ecshop/article_cat.php?id=$1
  22. RewriteRule ^(.*)/article_cat-([0-9]+)(.*)\.html$ $1/article_cat\.php\?id=$2
  23. #RewriteRule /ecshop/article-([0-9]+)(.*)\.html$/ecshop/article.php?id=$1
  24. RewriteRule ^(.*)/article-([0-9]+)(.*)\.html$$1/article\.php\?id=$2
  25. #RewriteRule /ecshop/brand-([0-9]+)-c([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)\.html /ecshop/brand.php?id=$1&cat=$2&page=$3&sort=$4&order=$5
  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
  27. #RewriteRule /ecshop/brand-([0-9]+)-c([0-9]+)-([0-9]+)(.*)\.html/ecshop/brand.php?id=$1&cat=$2&page=$3
  28. RewriteRule ^(.*)/brand-([0-9]+)-c([0-9]+)-([0-9]+)(.*)\.html$1/brand\.php\?id=$2&cat=$3&page=$4
  29. #RewriteRule /ecshop/brand-([0-9]+)-c([0-9]+)(.*)\.html /ecshop/brand.php?id=$1&cat=$2
  30. RewriteRule ^(.*)/brand-([0-9]+)-c([0-9]+)(.*)\.html $1/brand\.php\?id=$2&cat=$3
  31. #RewriteRule /ecshop/brand-([0-9]+)(.*)\.html/ecshop/brand.php?id=$1
  32. RewriteRule ^(.*)/brand-([0-9]+)(.*)\.html$1/brand\.php\?id=$2
  33. #RewriteRule /ecshop/tag-(.*)\.html/ecshop/search.php?keywords=$1
  34. RewriteRule ^(.*)/tag-(.*)\.html$1/search\.php\?keywords=$2
复制代码

7# wufanan


谢谢哦,我试一试,
我原来,ECshop 是装在ecshop文件夹里面的,用的是http://www.13354833.cn/ecshop来访问的
现在我把整个文件夹内的东西都移动到了根目录。直接http://www.13354833.cn/ 即可访问

请问你这个代码还可以么?
是不是把里面的 ecshop/ 全部删除了,即可?

好像是,你试试咯