kuluutu 发表于 2011-9-5 11:02:07

nginx的zencart 1.3.8,lightinthebox模板的伪静态规则怎么写?

我用的是zen cart 1.3.8的lightinthebox 模板,nginx的伪静态怎么写?又用了一个1.3.9h的zencart的伪静态,出现错误,一点产品就出现404。
1.38 lightinthebox模板的htaccess文件的内容如下:

##### NOTE: Replace /shop/ with the relative web path of your catalog in the "Rewrite Base" line below:

Options +FollowSymLinks
RewriteEngine On
RewriteBase /

# From Ultimate SEO URLs
RewriteRule ^print_page_p(.*)$ index\.php?main_page=print_page&products_id=$1&%{QUERY_STRING}
RewriteRule ^(.*)_p(.*).html$ index\.php?main_page=product_info&products_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)_c(+)$ index\.php?main_page=index&cPath=$2&%{QUERY_STRING}
RewriteRule ^(.*)_c(+)/([-\w]*)$ index\.php?main_page=index&cPath=$2&display=$3&%{QUERY_STRING}
RewriteRule ^(.*)_c(+)/([-\w]*)/([-\w]*).html$ index\.php?main_page=index&cPath=$2&display=$3&%{QUERY_STRING}
RewriteRule ^(.*)-m-(+).html$ index\.php?main_page=index&manufacturers_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-pi-(+).html$ index\.php?main_page=popup_image&pID=$2&%{QUERY_STRING}
RewriteRule ^(.*)-pr-(+).html$ index\.php?main_page=product_reviews&products_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-pri-(+).html$ index\.php?main_page=product_reviews_info&products_id=$2&%{QUERY_STRING}

RewriteRule ^producttags/([-\w]+)/$ index\.php?main_page=producttags&letter=$1&%{QUERY_STRING}
RewriteRule ^producttags/([\w])/(+).html$ index\.php?main_page=producttags&letter=$1&page=$2&%{QUERY_STRING}
RewriteRule ^wishlist/$ index\.php?main_page=wishlist
RewriteRule ^wishlist/([\w])/$ index\.php?main_page=wishlist&letter=$1&%{QUERY_STRING}
RewriteRule ^wishlist/([\w])/(+).html$ index\.php?main_page=wishlist&letter=$1&page=$2&%{QUERY_STRING}
# For Open Operations Info Manager
RewriteRule ^(.*)-i-(+).html$ index\.php?main_page=info_manager&pages_id=$2&%{QUERY_STRING}

# For dreamscape's News & Articles Manager
RewriteRule ^news/?$ index\.php?main_page=news&%{QUERY_STRING}
RewriteRule ^news/rss.xml$ index\.php?main_page=news_rss&%{QUERY_STRING}
RewriteRule ^news/archive/?$ index\.php?main_page=news_archive&%{QUERY_STRING}
RewriteRule ^news/({4})-({2})-({2}).html$ index\.php?main_page=news&date=$1-$2-$3&%{QUERY_STRING}
RewriteRule ^news/archive/({4})-({2}).html$ index\.php?main_page=news_archive&date=$1-$2&%{QUERY_STRING}
RewriteRule ^news/(.*)-a-(+)-comments.html$ index\.php?main_page=news_comments&article_id=$2&%{QUERY_STRING}
RewriteRule ^news/(.*)-a-(+).html$ index\.php?main_page=news_article&article_id=$2&%{QUERY_STRING}

# All other pages
# Don't rewrite real files or directories
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*).html$ index\.php?main_page=$1&%{QUERY_STRING}

我修改的如下:
# if the requested file exists, return it immediately
      if (-f $request_filename) {
                break;
      }
         rewrite "^print_page_p(.*)$" /index.php?main_page=print_page&products_id=$1&% last;
         rewrite "^/(.*)_p(.*).html$" /index\.php?main_page=product_info&products_id=$2&% last;
      
         rewrite "^/(.*)_c(+)$" /index\.php?main_page=index&cPath=$2&% last;
         rewrite "^/(.*)_c(+)/([-\w]*)$" /index\.php?main_page=index&cPath=$2&display=$3&% last;
         rewrite "^/(.*)_c(+)/([-\w]*)/([-\w]*).html$" /index\.php?main_page=index&cPath=$2&display=$3&% last;
         rewrite "^/(.*)-m-(+).html$" /index\.php?main_page=index&manufacturers_id=$2&% last;
         rewrite "^/(.*)-pi-(+).html$" /index\.php?main_page=popup_image&pID=$2&% last;
         rewrite "^/(.*)-pr-(+).html$" /index\.php?main_page=product_reviews&products_id=$2&% last;
         rewrite "^/(.*)-pri-(+).html$" /index\.php?main_page=product_reviews_info&products_id=$2&% last;
      
# For Open Operations Info Manager
      rewrite "^(.*)-i-(+).html" /index.php?main_page=info_manager&pages_id=$2&% last;
      
# For dreamscape?ˉs News & Articles Manager
      rewrite "^news/?" /index.php?main_page=news&% last;
      rewrite "^news/rss.xml" /index.php?main_page=news_rss&% last;
      rewrite "^news/archive/?" /index.php?main_page=news_archive&% last;
      rewrite "^news/({4})-({2})-({2}).html" /index.php?main_page=news&date=$1-$2-$3&% last;
      rewrite "^news/archive/({4})-({2}).html" /index.php?main_page=news_archive&date=$1-$2&% last;
      rewrite "^news/(.*)-a-(+)-comments.html" /index.php?main_page=news_comments&article_id=$2&% last;
      rewrite "^news/(.*)-a-(+).html" /index.php?main_page=news_article&article_id=$2&% last;
      
# All other pages
      rewrite "^(.*).html" /index.php?main_page=$1&% last;

# product tags
      rewrite "^/producttags/([-\w]+)/$" /index.php?main_page=producttags&letter=$1&% last;
      rewrite "^/producttags/([\w])/(+).html$" /index.php?main_page=producttags&letter=$1&page=$2&% last;
      rewrite "^wishlist/$" /index\.php?main_page=wishlist last;
      rewrite "^wishlist/([\w])/$" /index.php?main_page=wishlist&letter=$1&% last;
      rewrite "^wishlist/([\w])/(+).html$" /index.php?main_page=wishlist&letter=$1&page=$2&% last;
这样改了,也是一点产品就出错,404!应该怎么修改?(感觉红色那几行好像有问题!)

[ 本帖最后由 kuluutu 于 2011-9-5 11:25 编辑 ]

licess 发表于 2011-9-5 12:51:20

伪静态不太了解,网上好像有zencart的伪静态吧

kuluutu 发表于 2011-9-5 14:18:12

原帖由 licess 于 2011-9-5 12:51 发表 https://bbs.vpser.net/images/common/back.gif
伪静态不太了解,网上好像有zencart的伪静态吧

网上的都不能用。这个模板有些特殊呀。

justsoso 发表于 2011-9-5 19:29:42

http://www.anilcetin.com/convert-apache-htaccess-to-nginx/
试一试这个链接
不行然后具体在改改

licess 发表于 2011-9-5 20:05:01

回复 4# 的帖子

zencart官网找个试试

kuluutu 发表于 2011-9-7 01:01:47

感谢。:) :) :)
页: [1]
查看完整版本: nginx的zencart 1.3.8,lightinthebox模板的伪静态规则怎么写?