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

ecshop的伪静态规则万能版(htaccess格式),规则不行的用这个就对了!

伪静态规则实例 野狼 1011浏览

网络是个好东西,很多东西有人分享,但是让人头疼的是,有很多人不负责任的分享一些东西,总是乱七八糟的,反而是帮倒忙。野狼SEO团队经常接到一些朋友的单子,说是要给伪静态弄一下,有几个问题搞不定。有的客户弄了几个星期搞不定,野狼一看原来是少了一条规则!所以,趁着给别人做ecshop伪静态规则的过程,野狼总结出一个比较全面的规则,分享一下,只要是ecshop的htaccess规则,绝对能搞定。

ecshop_htaccess

ecshop_htaccess

RewriteEngine On

RewriteBase /

#野狼SEO团队优优提供技术支持QQ1615241386

RewriteRule ^index\.html$ index\.php [L]

RewriteRule ^category$ index\.php [L]

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

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

RewriteRule ^(.*)feed-type([^-]+)\.xml$ $1feed\.php\?type=$2 [L]

RewriteRule ^(.*)feed\.xml$ $1feed\.php [L]

RewriteRule ^(.*)category-([0-9]+)-b([0-9]+)-min([0-9]+)-max([0-9]+)-attr([^-]*)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$ $1category\.php\?id=$2&brand=$3&price_min=$4&price_max=$5&filter_attr=$6&page=$7&sort=$8&order=$9 [QSA,L]

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

RewriteRule ^(.*)tag-(.*)\.html $1search\.php\?keywords=$2 [QSA,L]

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

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

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

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

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

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

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

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

当然,如果还不行,你可以考虑一下情况:

(1)你的程序是二次开发得来的,有些链接结构被修改过了,需要自定义伪静态规则

(2)你服务器是否支持htaccess的伪静态规则

(3)未知疑难杂症……

如果您觉得这个规则仍有问题,可以告诉博主,或者到我们的讨论群里,共同完善最

转载请注明:伪静态技术博客 » ecshop的伪静态规则万能版(htaccess格式),规则不行的用这个就对了!