Mymps和Discuz在Nginx下的伪静态规则
2010年08月4日 # 4:00 下午 # 网站建设 # 4 评论继上篇对Mymps安装与Ucenter整合问题的解决,大致对所用到的程序已经锁定,下一步考虑运行环境的问题。在本地架设的LAMP环境是用Xampp快速搭建的,只为本地调试程序所用,而考虑到今后网站运营环境所要求的性能比较高,对此也在进行不断的学习。
规划网站使用VPS应用环境,初步定位是在Centos下搭建LNMP,但是目前Mymps和Discuz X1都是应用在Apache,为了顺利应用在Nginx下,分别对伪静态规则做以下整理:
一、Mymps1.6在Nginx Web Server下的伪静态规则:
rewrite ^/info-id-([0-9]+)\/$ /public/info.php?id=$1;
rewrite ^/info-catid-([0-9]+)-page-([0-9]+)\/$ /public/info.php?catid=$1&page=$2;
rewrite ^/info-catid-([0-9]+)-areaid-([0-9]+)-page-([0-9]+)\/$ /public/info.php?catid=$1&areaid=$2&page=$3;
rewrite ^/aboutus\/$ /public/about.php?part=aboutus;
rewrite ^/aboutus-id-([0-9]+)\/$ /public/about.php?part=aboutus&id=$1;
rewrite ^/announce-page-([0-9]+)\/$ /public/about.php?part=announce&page=$1;
rewrite ^/announce-id-([0-9]+)\/$ /public/about.php?part=announce&id=$1;
rewrite ^/faq\/$ /public/about.php?part=faq;
rewrite ^/faq-id-([0-9]+)\/$ /public/about.php?part=faq&id=$1;
rewrite ^/friendlink\/$ /public/about.php?part=friendlink;
rewrite ^/friendlink-action-apply\/$ /public/about.php?part=friendlink&action=apply;
rewrite ^/guestbook-page-([0-9]+)\/$ /public/about.php?part=guestbook&page=$1;
rewrite ^/guestbook-action-write\/$ /public/about.php?part=guestbook&action=write;
rewrite ^/space-([a-z,0-9\-]+)\/$ /public/space.php?user=$1;
二、DISCUZ!X1.0在Nginx Web Server下的伪静态规则:
rewrite ^(.*)/topic-(.+)\.html$ $1/portal.php?mod=topic&topic=$2 last;
rewrite ^(.*)/article-([0-9]+)\.html$ $1/portal.php?mod=article&articleid=$2 last;
rewrite ^(.*)/forum-(\w+)-([0-9]+)\.html$ $1/forum.php?mod=forumdisplay&fid=$2&page=$3 last;
rewrite ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=viewthread&tid=$2&extra=page%3D$4&page=$3 last;
rewrite ^(.*)/group-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=group&fid=$2&page=$3 last;
rewrite ^(.*)/space-(username|uid)-(.+)\.html$ $1/home.php?mod=space&$2=$3 last;
rewrite ^(.*)/([a-z]+)-(.+)\.html$ $1/$2.php?rewrite=$3 last;
网络上有很多朋友也在找Mymps在Nginx下的伪静态规则,自己做整理分享,也用以备用。规划的网站可能还要过一段时间才可以上线,网站建设还在初级阶段,希望自己坚持用心做下去!
RSS 订阅
评论 RSS







伪静态不是对服务器还有要求吗 我的博客就是不能用伪静态
@zzzhu 伪静态规则就是要添加到在web服务器上,博客不能用伪静态说明服务器没有应用相应的规则。
要坚持下去哦 加油!支持你….
哈哈。我用的dz开发的ss。哥们的博客做的不错