关于zencart的伪静态规则问题?wd哥求帮助!

以下是zencart伪静态规则,但是我在后台建立了一个zencart_apache.conf文件,使用之后直接出错。请问如何修改?

Options +FollowSymLinks

RewriteEngine On
RewriteBase /
 
# From Ultimate SEO URLs
RewriteRule ^(.*)-p-(.*).html$ index\.php?main_page=product_info&products_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-c-([^-]+)-page-([0-9]+).html$ index\.php?main_page=index&cPath=$2&page=$3&sort=20a&%{QUERY_STRING} [L]
RewriteRule ^(.*)-c-([^-]*).html$ index\.php?main_page=index&cPath=$2&%{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 ^(.*)-ezp-([0-9]+).html$ index\.php?main_page=page&id=$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]
 
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]
RewriteRule ^producttags/(.*)/([0-9]+).html$ index.php?main_page=producttags&letter=$1&page=$2&%{QUERY_STRING} [L]
欢迎转载,但请保留此信息
[我的Linux,让Linux更易用] CentOS精简版,集成lamp,lnmp版,wdcp,wdcdn,wddns,一键安装包,集群负载均衡LVS,智能DNS/CDN,性能优化
本文连接:http://wdlinux.cn/old/node/4963

1 确认规则是否都是正常的 2

1 确认规则是否都是正常的
2 可直接加到主机配置文件中来测试

这个在htaccess文件中是正常的,但是放到conf中就不正常了。

 这个在htaccess文件中是正常的,但是放到conf中就不正常了。
放到主机配置文件中,因为他的重写规则中有下面这个代码
RewriteBase /
一旦重启会有个问题。
RewriteBase: only valid in per-directory config files

 

你也可以用.htaccess文件的方式,放到网站根目录下

你也可以用.htaccess文件的方式,放到网站根目录下

 看来只能用htaccess控制了

 看来只能用htaccess控制了