|
|
1#
发表于 2009-7-29 19:39
| 只看该作者
本人对Apache2.2,nginx rewrite 技术不熟,发了3天研究出来的,希望对你们有些帮助。nginx伪静发其实很简单,本来是一个小时搞定的事,官方给的.htaccess文件误导了我。RewriteRule ^information-(.+)/\?*(.*)$ buy_list\.php\?limit=$1 跳转的目标中的.和?好像不需要转义吧,应该这样才对:buy_list.php?limit=$1
以下是nginx 重定向配置
打开nginx.conf配置文件 贴到server 中,我是放到结尾 ,404报错定向到404.php
server {
……
error_page 404 /404.php;
……
rewrite ^/product-(.+)-(.+)-(.+)/\?*(.*)$ /product_list.php?firstRow=$1&totalRows=$2&id=$3 last;
rewrite ^/product-(.+)-(.+)/\?*(.*)$ /product_list.php?firstRow=$1&totalRows=$2 last;
rewrite ^/product-(.+)/\?*(.*)$ /product_list.php?id=$1 last;
rewrite ^/product/\?*(.*)$ /product_list.php last;
rewrite ^/products-category/ /products_category.php last;
rewrite ^/news-(.+)/ /news_detail\.php?id=$1 last;
rewrite ^/bizserver-(.+)-(.+)-(.+)/ /news_list.php?firstRow=$1&totalRows=$2&id=$3 last;
rewrite ^/bizserver-(.+)/ /news_list.php?id=$1 last;
rewrite ^/bizserver/ /biz_server.php last;
rewrite ^/exhibition/ /exhibition.php last;
rewrite ^/exhibition-detail/(.+) /exhibition_detail.php?id=$1 last;
rewrite ^/exhibition-(.+)-(.+)/\?*(.*)$ /exhibition.php?firstRow=$1&totalRows=$2 last;
rewrite ^/company-(.+)-(.+)-(.+)/\?*(.*)$ /company_list.php?firstRow=$1&totalRows=$2&id=$3 last;
rewrite ^/company-(.+)-(.+)/\?*(.*)$ /company_list.php?firstRow=$1&totalRows=$2 last;
rewrite ^/company-(.+)/\?*(.*)$ /company_list.php?id=$1 last;
rewrite ^/company/\?*(.*)$ /company_list.php last;
rewrite ^/companys-category/\?*(.*)$ /companys_category.php last;
rewrite ^/uhome-(.+)-(.+)-(.+)-(.+) /shop.php?firstRow=$3&totalRows=$4&uid=$2&action=$1 last;
rewrite ^/uhome-(.+)-(.+)-(.+) /shop.php?uid=$2&action=$1&id=$3 last;
rewrite ^/uhome-(.+)-(.+) /shop\.php?uid=$1&action=$2 last;
rewrite ^/uhome-(.+) /shop\.php?uid=$1 last;
rewrite ^/info-(.+)-(.+)-(.+)/\?*(.*)$ /buy_list.php?firstRow=$1&totalRows=$2&id=$3 last;
rewrite ^/info-(.+)-(.+)/\?*(.*)$ /buy_list.php?firstRow=$1&totalRows=$2 last;
rewrite ^/info-(.+)/\?*(.*)$ /buy_list.php?id=$1 last;
rewrite ^/info/\?*(.*)$ /buy_list.php last;
rewrite ^/information-(.+)/\?*(.*)$ /buy_list.php?limit=$1 last;
rewrite ^/buy-category/\?*(.*)$ /buy_category.php last;
rewrite ^/job/ /job.php last;
rewrite ^/announcement/(.+) /announcement.php?id=$1 last;
rewrite ^/changelink/ /change_link.php last;
}
朋友的公司想做个b2b电子商务,百度,google 搜了搜,php中友邻、php168 b2b、B2Bbuilder都试用一下,B2Bbuilder,在UC整合,多语言相对好一些,标签跨站调用,纯净发技术功能不足,希望官方多下点功夫。等着买你们的授权呢。 |
-
1
评分次数
-
|