kloxo下配置lighttpd下的zencart 1.3.9h基于ultimate seo urls插件的伪静态规则

Posted by yar999 in lighttpd on 2010/11/07 with No Comments

环境:
kloxo面板的lighttpd php mysql
zencart 1.3.9h
伪静态插件ultimate seo urls 2.101

zencart及ultimate seo urls插件的安装,网上有很多教程我们这里就不再赘述了。

您登录进kloxo之后,选择您的域名,然后在右边点 lighttpd地址重写规则 ,然后把下面的伪静态规则贴进去,然后点update。这样就配置好了lighttpd下的zencart基于ultimate seo urls插件的伪静态规则。
配置好规则之后您需要重启lighttpd才可以是伪静态规则生效。
怎么重启lighttpd,请参见http://rashost.com/blog/kloxo-newdomain

注意:
需要使用ultimate seo urls这个插件默认的seo.url.php文件,
如果您修改了seo.url.php则下面的规则无法工作
ultimate seo urls插件安装好的默认配置如下

登录zencart后台 -> Configuration -> SEO URLs -> Enter pages to allow rewrite


内容如下:
index, product_info, products_new, products_all, featured_products, specials, contact_us, conditions, privacy, reviews, shippinginfo, faqs_all, site_map, gv_faq, discount_coupon, page, page_2, page_3, page_4

ssh登录之后执行下面的命令升级lighttpd


yum update -y lighttpd
/etc/init.d/lighttpd restart

伪静态规则:

url.rewrite-if-not-file = (
"^/news$" => "index.php?main_page=news",
"^/page\.html\?chapter=(.*)&id=(.*)$"=>"/index.php?main_page=page&id=$2&chapter=$1",
"^/page\.html\?id=(.*)$"=>"/index.php?main_page=page&id=$1",
"^/(.*)-ezp-(.*)\.html(\?(.*))*$"=>"/index.php?main_page=page&id=$2",
"^/page_(.*)\.html$"=>"/index.php?main_page=page_$1",
"^/checkout\/cart\/(\?(.*))?$" => "/index.php?main_page=shopping_cart&$2",
"^/(.*)-p-(.*)\.html(\?(.*))?$" => "/index.php?main_page=product_info&products_id=$2&$4",
"^/(.*)-a-(.*)\.html(\?(.*))?$" => "index.php?main_page=news_article&article_id=$2&$4",
"^/(.*)-c-(.*)\.html(\?(.*))?$" => "/index.php?main_page=index&cPath=$2&$4",
"^/(.*)-pi-([0-9] )\.html(\?(.*))?$" => "/index.php?main_page=popup_image&pID=$2&$4",
"^/(.*)-m-([0-9] )\.html(\?(.*))?$" => "/index.php?main_page=index&manufacturers_id=$2&$4",
"^/(.*)-pr-([0-9] )\.html(\?(.*))?$" => "/index.php?main_page=product_reviews&product_id=$2&$4",
"^/(.*)-pri-([0-9] )\.html(\?(.*))?$" => "/index.php?main_page=product_reviews_info&product_id=$2&$4",
"^/checkout\/shipping_method\/(\?(.*))?$" => "/index.php?main_page=checkout_shipping&$2",
"^/news/archive/(.*)\.html$" => "/index.php?main_page=news_archive&date=$1",
"^/news/([0-9]{4})-([0-9]{2})-([0-9]{2}).html(\?(.*))?$" => "index.php?main_page=news&date=$1-$2-$3&$4",
"^(.*)\.html(\?(.*))?$"=>"/index.php?main_page=$1&$3",
#"^(.*)\.html((.*))?$"=>"/index.php?main_page=$1&$3"
)

Leave a Comment

Back to Top

2007-2013 © 北京瑞豪开源科技有限公司 京ICP备13004995号-2