剛給朋友處理個ecshop的站點,他的偽靜態規則出了點問題,網站找了不少時間,都沒找到個合適,哎,現在的人啊,怎么這么不地道。下面給大家分享個ecshop的httpd.ini版本偽靜態規則。
[ISAPI_Rewrite]
# ECSHOP
RewriteRule /index.html /index.php
RewriteRule /default.html /index.php
RewriteRule /ecshop/feed.xml /ecshop/feed.php
#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
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
#RewriteRule /ecshop/category-([0-9]+)-b([0-9]+)-([0-9]+)(.*)/.html$ /ecshop/category.php?id=$1&brand=$2&page=$3
RewriteRule ^(.*)/category-([0-9]+)-b([0-9]+)-([0-9]+)(.*)/.html$ $1/category/.php/?id=$2&brand=$3&page=$4
#RewriteRule /ecshop/category-([0-9]+)-b([0-9]+)(.*)/.html$ /ecshop/category.php?id=$1&brand=$2
RewriteRule ^(.*)/category-([0-9]+)-b([0-9]+)(.*)/.html$ $1/category/.php/?id=$2&brand=$3
#RewriteRule /ecshop/category-([0-9]+)(.*)/.html$ /ecshop/category.php?id=$1
RewriteRule ^(.*)/category-([0-9]+)(.*)/.html$ $1/category/.php/?id=$2
#RewriteRule /ecshop/goods-([0-9]+)(.*)/.html$ /ecshop/goods.php?id=$1
RewriteRule ^(.*)/goods-([0-9]+)(.*)/.html$ $1/goods/.php/?id=$2
#RewriteRule /ecshop/article_cat-([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)/.html$ /ecshop/article_cat.php?id=$1&page=$2&sort=$3&order=$4
RewriteRule ^(.*)/article_cat-([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)/.html$ $1/article_cat/.php/?id=$2&page=$3&sort=$4&order=$5
#RewriteRule /ecshop/article_cat-([0-9]+)-([0-9]+)(.*)/.html$ /ecshop/article_cat.php?id=$1&page=$2
RewriteRule ^(.*)/article_cat-([0-9]+)-([0-9]+)(.*)/.html$ $1/article_cat/.php/?id=$2&page=$3
#RewriteRule /ecshop/article_cat-([0-9]+)(.*)/.html$ /ecshop/article_cat.php?id=$1
RewriteRule ^(.*)/article_cat-([0-9]+)(.*)/.html$ $1/article_cat/.php/?id=$2
#RewriteRule /ecshop/article-([0-9]+)(.*)/.html$ /ecshop/article.php?id=$1
RewriteRule ^(.*)/article-([0-9]+)(.*)/.html$ $1/article/.php/?id=$2
#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
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
#RewriteRule /ecshop/brand-([0-9]+)-c([0-9]+)-([0-9]+)(.*)/.html /ecshop/brand.php?id=$1&cat=$2&page=$3
RewriteRule ^(.*)/brand-([0-9]+)-c([0-9]+)-([0-9]+)(.*)/.html $1/brand/.php/?id=$2&cat=$3&page=$4
#RewriteRule /ecshop/brand-([0-9]+)-c([0-9]+)(.*)/.html /ecshop/brand.php?id=$1&cat=$2
RewriteRule ^(.*)/brand-([0-9]+)-c([0-9]+)(.*)/.html $1/brand/.php/?id=$2&cat=$3
#RewriteRule /ecshop/brand-([0-9]+)(.*)/.html /ecshop/brand.php?id=$1
RewriteRule ^(.*)/brand-([0-9]+)(.*)/.html $1/brand/.php/?id=$2
其中加#RewriteRule是注釋掉的,是ecshop放在子目錄時候用的偽靜態規則。
需要說明的是,一般這樣格式的文件是IIS6支持的,如果不管用不是規則不行,可能的情況有:1、沒有安裝偽靜態組件 2、安裝的偽靜態組件并不支持httpd.ini,可能是支持http.conf或者.htaccess的。所以處理的時候要看清楚,你的服務器到底支持哪種偽靜態,防止不能使用著急啊!.htaccess的可以參看《ecshop偽靜態規則.htaccess格式》
以上就是ecshop的httpd.ini格式偽靜態規則的全部內容,希望對大家的學習和解決疑問有所幫助,也希望大家多多支持武林網。
新聞熱點
疑難解答