网站地图    收藏   

主页 > 后端 > ecshop教程 >

ecshop伪静态.htaccess的规则代码 - ecshop

来源:自学PHP网    时间:2014-11-28 23:31 作者: 阅读:

[导读] htaccess的rewrite代码如下:RewriteEngineOn directone-wordaccessRewriteRule^index html$index php[L]RewriteRule^category$index php[L] accessanyobjectbyitsnumerici...

ecshop伪静态.htaccess的规则代码

.htaccess的rewrite代码如下:

  1. RewriteEngine On 
  2. # direct one-word access 
  3. RewriteRule ^index\.html$ index\.php [L] 
  4. RewriteRule ^category$ index\.php [L] 
  5. # access any object by its numeric identifier 
  6. RewriteRule ^feed-c([0-9]+)\.xml$ feed\.php\?cat=$1 [L] 
  7. RewriteRule ^feed-b([0-9]+)\.xml$ feed\.php\?brand=$1 [L] 
  8. RewriteRule ^feed\.xml$ feed\.php [L] 
  9. RewriteRule ^category-([0-9]+)-b([0-9]+)-min([0-9]+)-max([0-9]+)-attr([^-]*)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$ category\.php\?id=$1&brand=$2&price_min=$3&price_max=$4&filter_attr=$5&page=$6&sort=$7&order=$8 [QSA,L] 
  10. RewriteRule ^category-([0-9]+)-b([0-9]+)-min([0-9]+)-max([0-9]+)-attr([^-]*)(.*)\.html$ category\.php\?id=$1&brand=$2&price_min=$3&price_max=$4&filter_attr=$5 [QSA,L] 
  11. RewriteRule ^category-([0-9]+)-b([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$ category\.php\?id=$1&brand=$2&page=$3&sort=$4&order=$5 [QSA,L] 
  12. RewriteRule ^category-([0-9]+)-b([0-9]+)-([0-9]+)(.*)\.html$ category\.php\?id=$1&brand=$2&page=$3 [QSA,L] 
  13. RewriteRule ^category-([0-9]+)-b([0-9]+)(.*)\.html$ category\.php\?id=$1&brand=$2 [QSA,L] 
  14. RewriteRule ^category-([0-9]+)(.*)\.html$ category\.php\?id=$1 [QSA,L] 
  15. RewriteRule ^goods-([0-9]+)(.*)\.html$ goods\.php\?id=$1 [QSA,L] 
  16. RewriteRule ^article_cat-([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$ article_cat\.php\?id=$1&page=$2&sort=$3&order=$4 [QSA,L] 
  17. RewriteRule ^article_cat-([0-9]+)-([0-9]+)(.*)\.html$ article_cat\.php\?id=$1&page=$2 [QSA,L] 
  18. RewriteRule ^article_cat-([0-9]+)(.*)\.html$ article_cat\.php\?id=$1 [QSA,L] 
  19. RewriteRule ^article-([0-9]+)(.*)\.html$ article\.php\?id=$1 [QSA,L] 
  20. RewriteRule ^brand-([0-9]+)-c([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)\.html brand\.php\?id=$1&cat=$2&page=$3&sort=$4&order=$5 [QSA,L] 
  21. RewriteRule ^brand-([0-9]+)-c([0-9]+)-([0-9]+)(.*)\.html brand\.php\?id=$1&cat=$2&page=$3 [QSA,L] 
  22. RewriteRule ^brand-([0-9]+)-c([0-9]+)(.*)\.html brand\.php\?id=$1&cat=$2 [QSA,L] 
  23. RewriteRule ^brand-([0-9]+)(.*)\.html brand\.php\?id=$1 [QSA,L] 
  24. RewriteRule ^tag-(.*)\.html search\.php\?keywords=$1 [QSA,L] 
  25. RewriteRule ^snatch-([0-9]+)\.html$ snatch\.php\?id=$1 [QSA,L] 
  26. RewriteRule ^group_buy-([0-9]+)\.html$ group_buy\.php\?act=view&id=$1 [QSA,L] 
  27. RewriteRule ^auction-([0-9]+)\.html$ auction\.php\?act=view&id=$1 [QSA,L] 
把以上代码放到记事本里,然后上传到你的ecshop空间里的wwwroot根目录下,然后改记事本的名字为:.htaccess,之后你在ecshop商城后台设置一下伪静态.

自学PHP网专注网站建设学习,PHP程序学习,平面设计学习,以及操作系统学习

京ICP备14009008号-1@版权所有www.zixuephp.com

网站声明:本站所有视频,教程都由网友上传,站长收集和分享给大家学习使用,如由牵扯版权问题请联系站长邮箱904561283@qq.com

添加评论