Jul 21

Nginx下phpcms,wordpress,phpwind,ecshop,shopex伪静态设置 不指定

空城 , 2010/07/21 10:08 , 技术 » nginx , 评论(47) , 引用(0) , 阅读(472) , Via 本站原创 | |
Nginx (”engine x”) 是一个高性能的 HTTP 和 反向代理 服务器,也是一个 IMAP/POP3/SMTP 代理服务器。 Nginx 是由 Igor Sysoev 为俄罗斯访问量第二的 Rambler.ru 站点开发的,它已经在该站点运行超过两年半了。Igor 将源代码以类BSD许可证的形式发布。尽管还是测试版,但是,Nginx 已经因为它的稳定性、丰富的功能集、示例配置文件和低系统资源的消耗而闻名了。
  因为 Nginx 的文档大部分是俄文的,Nginx 的中文维基的目的是帮助使用中文世界的用户安装、配置和交换有关 Nginx 的使用经验。大部分文档源自Aleksandar Lazic 的工作。有关本维基本身的问题请直接询问Cliff Wells 。
  Nginx 可以在大多数 Unix like OS 上编译运行,并有 Windows 移植版。目前 Nginx 的开发版为 0.7.x,稳定版为 0.6.x,历史稳定版为 0.5.x,建议使用 0.6 系列作为生产版本。 Nginx 的源代码使用 2-clause BSD-like license。
  Nginx 的中文维基:http://wiki.codemongers.com/NginxChs
  Nginx 的中文站: http://www.nginx.cn

nginx下的伪静态规则:

PHPCMS:

location / {
###以下为PHPCMS 伪静态化rewrite规则
rewrite ^(.*)show-([0-9]+)-([0-9]+)\.html$ $1/show.php?itemid=$2&page=$3;
rewrite ^(.*)list-([0-9]+)-([0-9]+)\.html$ $1/list.php?catid=$2&page=$3;
rewrite ^(.*)show-([0-9]+)\.html$ $1/show.php?specialid=$2;
}

PHPWIND:
location / {
####以下为PHPWind 伪静态化rewrite规则
rewrite ^(.*)-htm-(.*)$ $1.php?$2 last;
rewrite ^(.*)/simple/([a-z0-9\_]+\.html)$ $1/simple/index.php?$2 last;
}

WordPress的nginx伪静态规则:

location / {
index index.html index.php;
if (-f $request_filename/index.html){
rewrite (.*) $1/index.html break;
}
if (-f $request_filename/index.php){
rewrite (.*) $1/index.php;
}
if (!-f $request_filename){
rewrite (.*) /index.php;
}
}

ECSHOP的nginx伪静态规则就比较复杂庞大了:

if (!-e $request_filename)
{
rewrite “^/index\.html” /index.php last;
rewrite “^/category$” /index.php last;
rewrite “^/feed-c([0-9]+)\.xml$” /feed.php?cat=$1 last;
rewrite “^/feed-b([0-9]+)\.xml$” /feed.php?brand=$1 last;
rewrite “^/feed\.xml$” /feed.php last;
rewrite “^/category-([0-9]+)-b([0-9]+)-min([0-9]+)-max([0-9]+)-attr([^-]*)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$” /category.php?id=$1&brand=$2&price_min=$3&price_max=$4&filter_attr=$5&page=$6&sort=$7&order=$8 last;
rewrite “^/category-([0-9]+)-b([0-9]+)-min([0-9]+)-max([0-9]+)-attr([^-]*)(.*)\.html$” /category.php?id=$1&brand=$2&price_min=$3&price_max=$4&filter_attr=$5 last;
rewrite “^/category-([0-9]+)-b([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$” /category.php?id=$1&brand=$2&page=$3&sort=$4&order=$5 last;
rewrite “^/category-([0-9]+)-b([0-9]+)-([0-9]+)(.*)\.html$” /category.php?id=$1&brand=$2&page=$3 last;
rewrite “^/category-([0-9]+)-b([0-9]+)(.*)\.html$” /category.php?id=$1&brand=$2 last;
rewrite “^/category-([0-9]+)(.*)\.html$” /category.php?id=$1 last;
rewrite “^/goods-([0-9]+)(.*)\.html” /goods.php?id=$1 last;
rewrite “^/article_cat-([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$” /article_cat.php?id=$1&page=$2&sort=$3&order=$4 last;
rewrite “^/article_cat-([0-9]+)-([0-9]+)(.*)\.html$” /article_cat.php?id=$1&page=$2 last;
rewrite “^/article_cat-([0-9]+)(.*)\.html$” /article_cat.php?id=$1 last;
rewrite “^/article-([0-9]+)(.*)\.html$” /article.php?id=$1 last;
rewrite “^/brand-([0-9]+)-c([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)\.html” /brand.php?id=$1&cat=$2&page=$3&sort=$4&order=$5 last;
rewrite “^/brand-([0-9]+)-c([0-9]+)-([0-9]+)(.*)\.html” /brand.php?id=$1&cat=$2&page=$3 last;
rewrite “^/brand-([0-9]+)-c([0-9]+)(.*)\.html” /brand.php?id=$1&cat=$2 last;
rewrite “^/brand-([0-9]+)(.*)\.html” /brand.php?id=$1 last;
rewrite “^/tag-(.*)\.html” /search.php?keywords=$1 last;
rewrite “^/snatch-([0-9]+)\.html$” /snatch.php?id=$1 last;
rewrite “^/group_buy-([0-9]+)\.html$” /group_buy.php?act=view&id=$1 last;
rewrite “^/auction-([0-9]+)\.html$” /auction.php?act=view&id=$1 last;
rewrite “^/exchange-id([0-9]+)(.*)\.html$” /exchange.php?id=$1&act=view last;
rewrite “^/exchange-([0-9]+)-min([0-9]+)-max([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$” /exchange.php?cat_id=$1&integral_min=$2&integral_max=$3&page=$4&sort=$5&order=$6 last;
rewrite ^/exchange-([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$” /exchange.php?cat_id=$1&page=$2&sort=$3&order=$4 last;
rewrite “^/exchange-([0-9]+)-([0-9]+)(.*)\.html$” /exchange.php?cat_id=$1&page=$2 last;
rewrite “^/exchange-([0-9]+)(.*)\.html$” /exchange.php?cat_id=$1 last;
}

商城程序shopex的nginx伪静态规则:

location / {
if (!-e $request_filename) {
rewrite ^/(.+\.(html|xml|json|htm|php|jsp|asp|shtml))$ /index.php?$1 last;
}
}

aajnty242 Email
2010/09/05 02:33
非常好的文章,非常的精彩,淘宝网女装连衣裙。真的很不错,。继续加油!
3jzedt2n0 Email Homepage
2010/09/04 15:18
这篇文章很不错,支持一下
5jzedt5s3 Email Homepage
2010/09/04 14:55
这篇文章很不错,支持一下
puce6h1g1 Email Homepage
2010/09/04 11:45
《囍》有功电表倒走器【qq100-325-9936致电15278374434黄经理】微电脑控表器(电表调校器,适合单相家用机械表、三相工业用表、电子表、IC卡表)是我公司最新开发出来的新奇特产品。本产品具有体积小,操作简单效果明显.本公司刚研发出针对电子轮显表,液晶表单相双相的,插上我们的设备20米电表就直接不走,拔掉以后电表自动工作正常,本产品可长时间使用,欢迎新老客户带表前来试验,订购,代理!!!有功电表倒走器q269855-512使用时,要将仪器贴近电表液晶显示表面位置,按上液晶表调校器开关1-3秒,液晶电表即可无显示,用电正常,不再计费。若想恢复,只要把仪器贴近电表液晶显示表面位置,按上液晶表调校器开关1-3秒,液晶电表即可显示,开始计费。
puce1e5b5 Email Homepage
2010/09/04 11:45
《囍》电子式电表慢转器【qq100-325-9936致电15278374434黄经理】微电脑控表器(电表调校器,适合单相家用机械表、三相工业用表、电子表、IC卡表)是我公司最新开发出来的新奇特产品。本产品具有体积小,操作简单效果明显.本公司刚研发出针对电子轮显表,液晶表单相双相的,插上我们的设备20米电表就直接不走,拔掉以后电表自动工作正常,本产品可长时间使用,欢迎新老客户带表前来试验,订购,代理!!!电子式电表慢转器q269855-512使用时,要将仪器贴近电表液晶显示表面位置,按上液晶表调校器开关1-3秒,液晶电表即可无显示,用电正常,不再计费。若想恢复,只要把仪器贴近电表液晶显示表面位置,按上液晶表调校器开关1-3秒,液晶电表即可显示,开始计费。
puce9p8g7 Email Homepage
2010/09/04 11:44
‖《家庭电表倒表器10-0325-9936q》‖【家庭电表倒表器13╱927╱22╱4604】帖子点不进去或此贴被删点击《百度快照》怎么让电表停转怎么让电表慢转怎么让电表倒转电表偷电技术电表偷电方法电表怎么偷电电表倒转技术电表倒转方法电表怎么倒转怎能使电表停转怎能使电表慢转怎能使电表倒转电表慢转技术电表慢转方法加扣扣聊六五一九七四三八富士康引发加薪潮部分企业欲迁离珠三角富士康一周两度加薪,推倒了加薪的“多米诺骨牌”,其他一些企业被迫跟进。《每日经济新闻》记者了解到,珠三角一些企业在加薪的同时,已在思考如何降低成本,比如把工厂迁到内陆城市甚至海外谈到加薪,美律财务副总裁曾锦堂昨日表示,不能随便跟随富士康,因为美律在深圳龙华也是龙头企业,一旦加薪,其他很多企业将会抱怨,公司的年度加薪幅度有待深圳市政府在7月1日宣布曾锦堂同时表示,目前公司已在规划如何应对珠三角地区劳动力价格上涨的情况,包括降低15%的年度材料成本,通过自动化降低劳工成本比例等,甚至从中长期考虑将生产线分散至内陆城市。不愿加薪的企业,也忙着寻找出路。《每日经济新闻》记者了解到,它们正打算将工厂从珠三角搬到劳动力成本更低的地方。
nikekc96 Email Homepage
2010/09/04 11:11
nikeoe64 Email Homepage
2010/09/04 11:10
vxj681skfx Email Homepage
2010/09/04 06:43
获得更多创业指导,就在商务指南 > 创业中心 > 创业宝典栏目
mlx199jfza Email Homepage
2010/09/04 03:47
新闻视频图片评论
财经股票港股基金 娱乐明星电影音乐
体育NBA彩票中超 汽车房产家居家电
科技数码手机下载 女性结婚育儿
时尚购物旅游 读书教育高考出国
游戏动漫动画星座 博客微博论坛
世博公益儿童玩更多同类游戏,请进入精选小游戏专题: 模拟经营餐饮开店小游戏全集
女生小游戏专区
同类游戏推荐 ·[经营]宇宙早餐店 2010.07.06
·[经营]西式汉堡餐厅 2010.cheap ghd07.06
·[经营]疯狂农场3 2010.07.06
·[经营]宇宙早餐厅 2010.07.06
·[经营]女孩洗衣店 2010.06.30
·[经营]熊猫抻面馆 2010.06.30
·[经营]美女烧烤派对 2010.06.29
·[经营]奶奶的花店 2010.06.29
分页: 1/5 第一页 1 2 3 4 5 下页 最后页
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]