VPS侦探论坛

 找回密码
 注册
查看: 9541|回复: 5

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

[复制链接]
发表于 2011-9-5 11:02:07 | 显示全部楼层 |阅读模式

我用的是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} [L]
RewriteRule ^(.*)_p(.*).html$ index\.php?main_page=product_info&products_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)_c([0-9]+)$ index\.php?main_page=index&cPath=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)_c([0-9]+)/([-\w]*)$ index\.php?main_page=index&cPath=$2&display=$3&%{QUERY_STRING} [L]
RewriteRule ^(.*)_c([0-9]+)/([-\w]*)/([-\w]*).html$ index\.php?main_page=index&cPath=$2&display=$3&%{QUERY_STRING} [L]
RewriteRule ^(.*)-m-([0-9]+).html$ index\.php?main_page=index&manufacturers_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-pi-([0-9]+).html$ index\.php?main_page=popup_image&pID=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-pr-([0-9]+).html$ index\.php?main_page=product_reviews&products_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-pri-([0-9]+).html$ index\.php?main_page=product_reviews_info&products_id=$2&%{QUERY_STRING} [L]

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

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

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

我修改的如下:
# 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([0-9]+)$" /index\.php?main_page=index&cPath=$2&% last;
         rewrite "^/(.*)_c([0-9]+)/([-\w]*)$" /index\.php?main_page=index&cPath=$2&display=$3&% last;
         rewrite "^/(.*)_c([0-9]+)/([-\w]*)/([-\w]*).html$" /index\.php?main_page=index&cPath=$2&display=$3&% last;
         rewrite "^/(.*)-m-([0-9]+).html$" /index\.php?main_page=index&manufacturers_id=$2&% last;
         rewrite "^/(.*)-pi-([0-9]+).html$" /index\.php?main_page=popup_image&pID=$2&% last;
         rewrite "^/(.*)-pr-([0-9]+).html$" /index\.php?main_page=product_reviews&products_id=$2&% last;
         rewrite "^/(.*)-pri-([0-9]+).html$" /index\.php?main_page=product_reviews_info&products_id=$2&% last;
      
# For Open Operations Info Manager
        rewrite "^(.*)-i-([0-9]+).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/([0-9]{4})-([0-9]{2})-([0-9]{2}).html" /index.php?main_page=news&date=$1-$2-$3&% last;
        rewrite "^news/archive/([0-9]{4})-([0-9]{2}).html" /index.php?main_page=news_archive&date=$1-$2&% last;
        rewrite "^news/(.*)-a-([0-9]+)-comments.html" /index.php?main_page=news_comments&article_id=$2&% last;
        rewrite "^news/(.*)-a-([0-9]+).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])/([0-9]+).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])/([0-9]+).html$" /index.php?main_page=wishlist&letter=$1&page=$2&% last;
  这样改了,也是一点产品就出错,404!应该怎么修改?(感觉红色那几行好像有问题!)

[ 本帖最后由 kuluutu 于 2011-9-5 11:25 编辑 ]
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2011-9-5 12:51:20 | 显示全部楼层


伪静态不太了解,网上好像有zencart的伪静态吧
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2011-9-5 14:18:12 | 显示全部楼层

原帖由 licess 于 2011-9-5 12:51 发表
伪静态不太了解,网上好像有zencart的伪静态吧


网上的都不能用。这个模板有些特殊呀。
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2011-9-5 19:29:42 | 显示全部楼层



http://www.anilcetin.com/convert-apache-htaccess-to-nginx/
试一试这个链接
不行然后具体在改改
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2011-9-5 20:05:01 | 显示全部楼层

回复 4# 的帖子


zencart官网找个试试

军哥运维代购:http://shop63846532.taobao.com/

 楼主| 发表于 2011-9-7 01:01:47 | 显示全部楼层

感谢。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-12-30 01:51 , Processed in 0.026908 second(s), 17 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表