客户服务
您当前位置:首页 >> 使用说明 >> 新闻动态

Oelove v2.1nginx的Rewrite规则分享

作者:  日期:2012-09-19  点击:   
nginx的市场现在全球第二了,相信很多朋友也都是用的nginx。 前几天帮着朋友搭建了一个婚恋网站,用的OElove商业版,呵呵,说实在的,Oelove确实非常强大。 一看就是官方在集国内各个婚恋网之所长而花大力气开发的。 虽然在很多细节上还有些不完善。但是着实说非常不错了。 网站搭建好后,看见官方只提供了IIS和apache的规则,虽然nginx在设置后也可以对.htaccess支持,但是感觉自己转换下更合适。 废话不说了,现将规则奉上。 注:本人分享的是商业版的,免费版的,大家把多余的去掉就行了。 rewrite ^/index.html$ /index.php last; rewrite ^/passport/([a-z]+)$ /passport.php?mod=$1 last; rewrite ^/about/([0-9]+).html$ /about.php?mod=detail&id=$1 last; rewrite ^/home$ /home.php last; rewrite ^/home/([0-9]+)$ /home.php?uid=$1 last; rewrite ^/home/([a-z]+)([0-9]+)$ /home.php?mod=$1&uid=$2 last; rewrite ^/home/([a-z]+)([0-9]+)/page/([0-9]+)$ /home.php?mod=$1&uid=$2&page=$3 last; rewrite ^/wish$ /wish.php last; rewrite ^/wish/page/([0-9]+)$ /wish.php?page=$1 last; rewrite ^/story$ /story.php last; rewrite ^/story/page/([0-9]+)$ /story.php?mod=list&page=$1 last; rewrite ^/story/category/([0-9]+)$ /story.php?mod=list&cid=$1 last; rewrite ^/story/category([0-9]+)/page/([0-9]+)$ /story.php?mod=list&cid=$1&page=$2 last; rewrite ^/story/([0-9]+).html$ /story.php?mod=detail&id=$1 last; rewrite ^/story([0-9]+)/page/([0-9]+)$ /story.php?mod=detail&id=$1&page=$2 last; rewrite ^/ask$ /ask.php last; rewrite ^/ask/page/([0-9]+)$ /ask.php?mod=list&page=$1 last; rewrite ^/ask/category/([0-9]+)$ /ask.php?mod=list&cid=$1 last; rewrite ^/ask/category([0-9]+)/page/([0-9]+)$ /ask.php?mod=list&cid=$1&page=$2 last; rewrite ^/ask/([0-9]+).html$ /ask.php?mod=detail&id=$1 last; rewrite ^/ask([0-9]+)/page/([0-9]+)$ /ask.php?mod=detail&id=$1&page=$2 last; rewrite ^/dating$ /dating.php last; rewrite ^/dating/page/([0-9]+)$ /dating.php?mod=list&page=$1 last; rewrite ^/dating/category/([0-9]+)$ /dating.php?mod=list&cid=$1 last; rewrite ^/dating/category([0-9]+)/page/([0-9]+)$ /dating.php?mod=list&cid=$1&page=$2 last; rewrite ^/dating/([0-9]+).html$ /dating.php?mod=detail&id=$1 last; rewrite ^/diary$ /diary.php last; rewrite ^/diary/page/([0-9]+)$ /diary.php?mod=list&page=$1 last; rewrite ^/diary/category/([0-9]+)$ /diary.php?mod=list&cid=$1 last; rewrite ^/diary/category([0-9]+)/page/([0-9]+)$ /diary.php?mod=list&cid=$1&page=$2 last; rewrite ^/diary/([0-9]+).html$ /diary.php?mod=detail&id=$1 last; rewrite ^/diary([0-9]+)/page/([0-9]+)$ /diary.php?mod=detail&id=$1&page=$2 last; rewrite ^/user$ /user.php last; rewrite ^/online$ /online.php last; rewrite ^/info$ /info.php last; rewrite ^/info/page/([0-9]+)$ /info.php?mod=list&page=$1 last; rewrite ^/info/category/([0-9]+)$ /info.php?mod=list&cid=$1 last; rewrite ^/info/category([0-9]+)/page/([0-9]+)$ /info.php?mod=list&cid=$1&page=$2 last; rewrite ^/info/([0-9]+).html$ /info.php?mod=detail&id=$1 last; rewrite ^/article$ /article.php last; rewrite ^/article/page/([0-9]+)$ /article.php?mod=list&page=$1 last; rewrite ^/article/category/([0-9]+)$ /article.php?mod=list&cid=$1 last; rewrite ^/article/category([0-9]+)/page/([0-9]+)$ /article.php?mod=list&cid=$1&page=$2 last; rewrite ^/article/([0-9]+).html$ /article.php?mod=detail&id=$1 last; rewrite ^/t/([0-9]+)$ /plugin.php?module=promotion&tuid=$1 last; if (!-e $request_filename) { return 404; } 复制代码Oelove v2.1nginx的Rewrite规则分享
上一篇:MLECMS的支付功能怎么弄呀?需要支付接口吗? 下一篇:【OELOVE-婚恋交友系统讨论区】 ? 请问一下,顶部,把人数显示改成时间怎么改 ..