打开 lnmp 伪静态文件目录:
cd /usr/local/nginx/conf
新建并编辑 discuzx25.conf 文件:
vi discuzx25.conf
按 i 进入编辑模式,添加下面的代码:
rewrite ^([^\.]*)/topic-(.+)\.html$ $1/portal.php?mod=topic&topic=$2 last;
rewrite ^([^\.]*)/article-([0-9]+)-([0-9]+)\.html$ $1/portal.php?mod=view&aid=$2&page=$3 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 ^([^\.]*)/blog-([0-9]+)-([0-9]+)\.html$ $1/home.php?mod=space&uid=$2&do=blog&id=$3 last;
rewrite ^([^\.]*)/(fid|tid)-([0-9]+)\.html$ $1/index.php?action=$2&value=$3 last;
rewrite ^([^\.]*)/([a-z]+[a-z0-9_]*)-([a-z0-9_\-]+)\.html$ $1/plugin.php?id=$2:$3 last;
if (!-e $request_filename) {
return 404;
}
按 esc 退出编辑模式,输入 :wq 保存退出。
然后进入网站配置文件目录:
cd /usr/local/nginx/conf/vhost
编辑对应的网站配置文件,比如 aaa.com.conf
vi aaa.com.conf
找到配置中的
include discuz.conf;
修改为
include discuzx25.conf;
保存后,重启 nginx或lnmp:
lnmp restart
注:以上是 lnmp 1.2 下的操作。
如对本文有疑问,
点击进行留言回复!!
相关文章:
-
-
-
-
-
-
UOS arm换源
清华源mv/etc/apt/sources.list /etc/apt/sources.list.bak备份原始...
[阅读全文]
-
-
IT基础与云计算
软路由器(IPtable)iptable是Linux上常用的防火墙软件。负载均衡负载均衡是网络基础构架的关键组件...
[阅读全文]
-
-
嵌入式行业职位分析
嵌入式开发涵盖硬件软件,开发链条很长,要根据自己的实际情况选择适应的职位。嵌入式的职位大概有:1、硬件工程师:负...
[阅读全文]
-
网友评论