最新消息:伪静态技术大全博客开通啦!再也不为伪静态东奔西走!更多问题可以反映给博主:野狼,QQ1615241386 QQ交流群:112696646

ecshop伪静态规则.htaccess格式,野狼亲测可用

伪静态规则实例 野狼 4726浏览 0评论

ecshop的伪静态规则,网上发布的比较多,但是有一些不支持团购,有一些有问题,野狼发布这个是自己都在用的规则,大家可以试试看(如果您二次开发过,可能会不太适合,可以联系野狼修改):

<FilesMatch “\.(bak|inc|lib|sh|tpl|lbi|dwt)$”>
order deny,allow
deny from all
</FilesMatch>

RewriteEngine On
#RewriteBase /

# direct one-word access
RewriteRule ^index\.html$ index\.php [L]
RewriteRule ^category$ index\.php [L]

# access any object by its numeric identifier
RewriteRule ^feed-c([0-9]+)\.xml$ feed\.php\?cat=$1 [L]
RewriteRule ^feed-b([0-9]+)\.xml$ feed\.php\?brand=$1 [L]
RewriteRule ^feed-type([^-]+)\.xml$ feed\.php\?type=$1 [L]
RewriteRule ^feed\.xml$ feed\.php [L]

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]
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]
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]
RewriteRule ^category-([0-9]+)-b([0-9]+)-([0-9]+)(.*)\.html$ category\.php\?id=$1&brand=$2&page=$3 [QSA,L]
RewriteRule ^category-([0-9]+)-b([0-9]+)(.*)\.html$ category\.php\?id=$1&brand=$2 [QSA,L]
RewriteRule ^category-([0-9]+)(.*)\.html$ category\.php\?id=$1 [QSA,L]

RewriteRule ^goods-([0-9]+)(.*)\.html$ goods\.php\?id=$1 [QSA,L]

RewriteRule ^article_cat-([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$ article_cat\.php\?id=$1&page=$2&sort=$3&order=$4 [QSA,L]
RewriteRule ^article_cat-([0-9]+)-([0-9]+)-(.+)(.*)\.html$ article_cat\.php\?id=$1&page=$2&keywords=$3 [QSA,L]
RewriteRule ^article_cat-([0-9]+)-([0-9]+)(.*)\.html$ article_cat\.php\?id=$1&page=$2 [QSA,L]
RewriteRule ^article_cat-([0-9]+)(.*)\.html$ article_cat\.php\?id=$1 [QSA,L]

RewriteRule ^article-([0-9]+)(.*)\.html$ article\.php\?id=$1 [QSA,L]

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]
RewriteRule ^brand-([0-9]+)-c([0-9]+)-([0-9]+)(.*)\.html brand\.php\?id=$1&cat=$2&page=$3 [QSA,L]
RewriteRule ^brand-([0-9]+)-c([0-9]+)(.*)\.html brand\.php\?id=$1&cat=$2 [QSA,L]
RewriteRule ^brand-([0-9]+)(.*)\.html brand\.php\?id=$1 [QSA,L]

RewriteRule ^tag-(.*)\.html search\.php\?keywords=$1 [QSA,L]
RewriteRule ^snatch-([0-9]+)\.html$ snatch\.php\?id=$1 [QSA,L]
RewriteRule ^group_buy-([0-9]+)\.html$ group_buy\.php\?act=view&id=$1 [QSA,L]
RewriteRule ^auction-([0-9]+)\.html$ auction\.php\?act=view&id=$1 [QSA,L]

RewriteRule ^exchange-id([0-9]+)(.*)\.html$ exchange\.php\?id=$1&act=view [QSA,L]
RewriteRule ^exchange-([0-9]+)-min([0-9]+)-max([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$ exchange\.php\?cat_id=$1&integral_min=$2&integral_max=$3&page=$4&sort=$5&order=$6 [QSA,L]
RewriteRule ^exchange-([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$ exchange\.php\?cat_id=$1&page=$2&sort=$3&order=$4 [QSA,L]
RewriteRule ^exchange-([0-9]+)-([0-9]+)(.*)\.html$ exchange\.php\?cat_id=$1&page=$2 [QSA,L]
RewriteRule ^exchange-([0-9]+)(.*)\.html$ exchange\.php\?cat_id=$1 [QSA,L]

ecshop的伪静态规则可不止这一种,更多的可以参考:

ecshop 2.73 IIS的httpd.conf格式点击这里:http://www.weijingtai.org/rule/ecshop-httpd-conf.html

其他版本的随后也会发布,敬请关注

转载请注明:伪静态技术博客 » ecshop伪静态规则.htaccess格式,野狼亲测可用

您必须 登录 才能发表评论!

网友最新评论 (3)

  1. 我的ecshop模版如果没有用自定义url目录插件时,我的模版伪静态都无错显示,当我使用自定义url目录时, 我的商品详情页中的跳转到指定位置的代码就失效了。原来点击后会跳到指定位置的。网页地址正常时为: www.xxx.com/goods/goods.html#ggcs,(goods为自定义的url,good.html为自定义商品页的名称)伪静态失败后该链接变成了www.xxx.com/#ggcs 无法识别当前路径了 缺少了goods/goods.html路径,,我的代码如下: ​规格参数 伪静态代码为 RewriteRule ^(?:[0-9a-zA-Z_]+)/([0-9a-zA-Z_-]+)(.*)\.html$ goods\.php\?defurl=$1 [QSA,L] 上网看了一下,我找到几个参考的,一些人说是伪静态要写绝对路径,但是我没有自定义url目录名时用伪静态是正常的呀。为什么自定义目录名后就代码就找不到路径了呢?有人说是伪静态的规则有问题,本人对伪静态规则不太懂,又无法解决下去了,要改代码的话,我加入全局变量,建了一个$url变量,用来获取当前网页地址规格参数,但这样获取到的的是goods.php的地址,虽然网址为www.xxx.com/goods.php#ggcs,但成功跳了,如果我这样做能解决问题,,每个网页都存在这个链接,但这样又很不利于seo,这就烦死了,能不能帮忙解决下,说说是什么问题,真情的感谢你!
    小小学徒求进步4年前 (2014-12-27)
  2. 从描述中看,我的判断是问题出在程序上而不是伪静态规则。野狼曾经遇到过你说的问题,当时是因为页面上被加了base代码,所以出现上边的情况。你的网站是php代码程序导致商品链接的a标签变了。具体还得看网站程序才行。以后再有问题博主没有及时回答可以加QQ1615241386
    野狼4年前 (2015-02-26)
  3. 好文章,内容出类拔萃.
    肉牛4年前 (2015-04-03)