prestashop 1.4.4的lighttpd rewrite规则

lighttpd的高效率成为很多小型的VPS下运行的网页服务,特别是免费的面板Kloxo就可以使用lighttpd. 但prestashop的重写规则都是针对apache的,所以要记录一下prestashop 1.4.4的lighttpd rewrite重写规则。

由于prestashop 1.4.3更新了一个新的“文件系统”,将图片文件分文件夹存放,为了同时兼容两种的文件存放方式,需要更改重写规则。

url.rewrite-once = (
“^/([a-z0-9]+)\-([a-z0-9]+)(\-[_a-zA-Z0-9-]*)/([_a-zA-Z0-9-]*)\.jpg$” => “/img/p/$1-$2$3.jpg”,
“^/([0-9]+)\-([0-9]+)/[_a-zA-Z0-9-]*\.jpg$” => “/img/p/$1-$2.jpg”,
“^/([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$” => “/img/p/$1/$1$2.jpg”,
“^/([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$” => “/img/p/$1/$2/$1$2$3.jpg”,
“^/([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$” => “/img/p/$1/$2/$3/$1$2$3$4.jpg”,
“^/([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$” => “/img/p/$1/$2/$3/$4/$1$2$3$4$5.jpg”,
“^/([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$” => “/img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6.jpg”,
“^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$” => “/img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7.jpg”,
“^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$” => “/img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8.jpg”,
“^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$” => “/img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9.jpg”,

“^/([0-9]+)(\-[_a-zA-Z0-9-]*)/([_a-zA-Z0-9-]*)\.jpg$” => “/img/c/$1$2.jpg”,
“^/lang-([a-z]{2})/([a-zA-Z0-9-]*)/([0-9]+)\-([a-zA-Z0-9-]*)\.html(\?(.*))?” => “/product.php?id_product=$3&isolang;=$1$6″,
“^/lang-([a-z]{2})/([0-9]+)\-([a-zA-Z0-9-]*)\.html(\?(.*))?” => “/product.php?id_product=$2&isolang;=$1&$4″,

“^/lang-([a-z]{2})/content/category/([0-9]+)\-([a-zA-Z0-9-]*)(\?(.*))?” => “/cms.php?id_cms_category=$2&isolang;=$1&$5″,

“^/lang-([a-z]{2})/content/([0-9]+)\-([a-zA-Z0-9-]*)(\?(.*))?” => “/cms.php?id_cms=$2&isolang;=$1&$4″,
“^/([a-zA-Z0-9-]*)/([0-9]+)\-([a-zA-Z0-9-]*)\.html(\?(.*))?” => “/product.php?id_product=$2&$5″,
“^/([0-9]+)\-([a-zA-Z0-9-]*)\.html(\?(.*))?” => “/product.php?id_product=$1&$4″,
“^/([0-9]+)\-([a-zA-Z0-9-]*)(\?(.*))?” => “/category.php?id_category=$1&$4″,
“^/lang-([a-z]{2})/([0-9]+)\-([a-zA-Z0-9-]*)(\?(.*))?” => “/category.php?id_category=$2&isolang;=$1&$5″,

“^/content/category/([0-9]+)\-([a-zA-Z0-9-]*)(\?(.*))?” => “/cms.php?id_cms_category=$1″,

“^/content/([0-9]+)\-([a-zA-Z0-9-]*)(\?(.*))?” => “/cms.php?id_cms=$1&$4″,
“^/([0-9]+)__([a-zA-Z0-9-]*)(\?(.*))?” => “/supplier.php?id_supplier=$1&$4″,
“^/([0-9]+)_([a-zA-Z0-9-]*)(\?(.*))?” => “/manufacturer.php?id_manufacturer=$1&$4″,
“^/lang-([a-z]{2})/(\?(.*))?” => “/index.php?isolang=$1&$2″,
“^/address(\?(.*))?” => “/address.php$1″,
“^/addresses(\?(.*))?” => “/addresses.php$1″,
“^/authentication(\?(.*))?” => “/authentication.php$1″,
“^/cart(\.php)?(\?(.*))?” => “/cart.php$2″,
“^/discount(\?(.*))?” => “/discount.php$1″,
“^/guest-tracking(\?(.*))?” => “/guest-tracking.php$1″,
“^/order-history(\?(.*))?” => “/history.php$1″,
“^/identity(\?(.*))?” => “/identity.php$1″,
“^/my-account(\?(.*))?” => “/my-account.php$1″,
“^/order(\?(.*))?” => “/order.php$1″,
“^/order-follow(\?(.*))?” => “/order-follow.php$1″,
“^/quick-order(\?(.*))?” => “/order-opc.php$1″,
“^/password-recovery(\?(.*))?” => “/password.php$1″,
“^/order-slip(\?(.*))?” => “/order-slip.php$1″,
“^/search(\?(.*))?” => “/search.php$1″,
“^/contact-us(\?(.*))?” => “/contact-form.php$1″,
“^/new-products(\?(.*))?” => “/new-products.php$1″,
“^/page-not-found(\?(.*))?” => “/404.php$1″,
“^/sitemap$” => “/sitemap.php$1″,
“^/best-sales(\?(.*))?” => “/best-sales.php$1″,
“^/prices-drop(\?(.*))?” => “/prices-drop.php$1″,
“^/stores(\?(.*))?” => “/stores.php$1″,
)

原文: http://www.dengor.com/archives/1358.html


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值