-
Oelove v2.1nginx的Rewrite规则分享。
-
-
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;
}
-
7073 次浏览
7 条评论
收藏
7个评论
-
-
--
2020-12-01 10:00
-
貌似我的积分还是不够啊
-
-
回复 · 0条回复
-
-
-
--
2020-12-01 10:00
-
说一下撒。。。。。。。。
-
-
回复 · 0条回复
-
-
-
--
2020-12-01 10:00
-
大哥。十分感谢分享。但是你总得教会我们怎么用才行吧。
-
-
回复 · 0条回复
-
-
-
--
2020-12-01 10:00
-
这些代码复制到.htaccess里面?
-
-
回复 · 0条回复
-
-
-
--
2020-12-01 10:00
-
这些代码复制到那里啊 ?怎么配置啊
-
-
回复 · 0条回复
-
-
-
wapsky
官方认证帐号 2020-12-01 10:00
-
{:soso_e181:}感谢分享!
我们会更努力!
-
-
回复 · 0条回复
-
-
-
--
楼主 2020-12-01 10:00
-
自己先占第一楼。。
-
-
回复 · 0条回复
-
作者信息
-
关注
-
试
免费试用
-
咨询热线
-
咨询热线
020-82299 259
-
在线咨询