伟大的互联网真是无所不能,只要你想要的想知道的基本上都可以查询得到,但是林子大了什么鸟都有,很多站点网站分享的东西不太负责,经常会有一些问题,所有361源码一直秉着认真踏实的态度给广大草根站长传授相关网站技巧和经验。例如前面我们介绍过的《ecshop的web.config格式伪静态规则》《ecshop的httpd.ini格式伪静态规则》等,今天要介绍的是ecshop伪静态规则万能版(htaccess格式)
RewriteEngine On
RewriteBase /#本规则由361源码整理分享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]
上面的ECSHOP规则保证有效实用,但是也可能你在使用的时候出现不能使用的情况,那么你这个时候就需要考虑如下的情况:
(1)你的程序是二次开发得来的,有些链接结构被修改过了,需要自定义伪静态规则
(2)你服务器是否支持htaccess的伪静态规则
(3)未知疑难杂症……
如果您觉得这个规则仍有问题,可以361源码的小编,我们会尽量完善。
以上就是ecshop伪静态规则万能版(htaccess格式)【推荐】的全部内容,希望对大家的学习和解决疑问有所帮助,也希望大家多多支持武林网。新闻热点
疑难解答