ECSHOP 伪静态问题

2016-07-07 15:25 来源:www.chinab4c.com 作者:ecshop专家

在apache 里面配置ECHSOP网站我就能实现了伪静态问题,但是我发现,我们公司里面的生产环境不是apache,是Nginx.这个我没有见过,但是也想用到伪静态,请问大虾,HELP ME..3Q

回答:
这一个我也没有见过,你的主机是用什么系统的

ecshop 的 nginx 伪静态规则

if (!-e $request_filename) {

#rewrite ^/index.html /index.php;
rewrite ^/category$/index.php;


rewrite ^/feed-c([0-9]+).xml$ /feed.php?cat=$1 ;
rewrite ^/feed-b([0-9]+).xml$ /feed.php?brand=$1 ;
rewrite ^/feed-type([^-]+).xml$/feed.php?type=$1 ;
rewrite ^/feed.xml$/feed.php ;

rewrite ^/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 ;
rewrite ^/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 ;
rewrite ^/category-([0-9]+)-b([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*).html$/category.php?id=$1&brand=$2&page=$3&sort=$4&order=$5 ;
rewrite ^/category-([0-9]+)-b([0-9]+)-([0-9]+)(.*).html$ /category.php?id=$1&brand=$2&page=$3;
rewrite ^/category-([0-9]+)-b([0-9]+)(.*).html$ /category.php?id=$1&brand=$2;
rewrite ^/category-([0-9]+)(.*).html$/category.php?id=$1;


rewrite ^/goods-([0-9]+)(.*).html$/goods.php?id=$1;

rewrite ^/article_cat-([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$/article_cat.php?id=$1&page=$2&sort=$3&order=$4;
rewrite ^/article_cat-([0-9]+)-([0-9]+)(.*)\.html$ /article_cat.php?id=$1&page=$2 ;
rewrite ^/article_cat-([0-9]+)(.*)\.html$ /article_cat.php?id=$1 ;

rewrite ^/article-([0-9]+)(.*)\.html$/article.php?id=$1 ;

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

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

rewrite ^/exchange-id([0-9]+)(.*)\.html$/exchange.php?id=$1&act=view;
rewrite ^/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;
rewrite ^/exchange-([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$ /exchange.php?cat_id=$1&page=$2&sort=$3&order=$4;
rewrite ^/exchange-([0-9]+)-([0-9]+)(.*)\.html$/exchange.php?cat_id=$1&page=$2;
rewrite ^/exchange-([0-9]+)(.*)\.html$/exchange.php?cat_id=$1;

rewrite ^/SpecialOffers.html /topic.php?topic_id=1 ;
rewrite ^/Celebrator.html /topic.php?topic_id=2 ;
rewrite ^/nomitang.html/topic.php?topic_id=4 ;
rewrite ^/privacy.html /topic.php?topic_id=5 ;
rewrite ^/Polylion.html/topic.php?topic_id=6 ;
rewrite ^/takeo.html/topic.php?topic_id=7 ;
rewrite ^/help-([0-9]+)(.*).html$/help.php?id=$1 ;


}

QQ 733905

谢谢..我试试