LNMP下添加Discuz x2.5的伪静态规则
打开LNMP伪静态文件目录:
cd/usr/local/nginx/conf
新建并编辑discuzx25.conf文件:
vidiscuzx25.conf
按i进入编辑模式,添加下面的代码:
rewrite^([^\.]*)/topic-(.+)\.html$$1/portal.php?mod=topic&topic=$2last;
rewrite^([^\.]*)/article-([0-9]+)-([0-9]+)\.html$$1/portal.php?mod=view&aid=$2&page=$3last;
rewrite^([^\.]*)/forum-(\w+)-([0-9]+)\.html$$1/forum.php?mod=forumdisplay&fid=$2&page=$3last;
rewrite^([^\.]*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$$1/forum.php?mod=viewthread&tid=$2&extra=page%3D$4&page=$3last;
rewrite^([^\.]*)/group-([0-9]+)-([0-9]+)\.html$$1/forum.php?mod=group&fid=$2&page=$3last;
rewrite^([^\.]*)/space-(username|uid)-(.+)\.html$$1/home.php?mod=space&$2=$3last;
rewrite^([^\.]*)/blog-([0-9]+)-([0-9]+)\.html$$1/home.php?mod=space&uid=$2&do=blog&id=$3last;
rewrite^([^\.]*)/(fid|tid)-([0-9]+)\.html$$1/index.php?action=$2&value=$3last;
rewrite^([^\.]*)/([a-z]+[a-z0-9_]*)-([a-z0-9_\-]+)\.html$$1/plugin.php?id=$2:$3last;
if(!-e$request_filename){
return404;
}
按Esc退出编辑模式,输入:wq保存退出。
然后进入网站配置文件目录:
cd/usr/local/nginx/conf/vhost
编辑对应的网站配置文件,比如aaa.com.conf
viaaa.com.conf
找到配置中的
includediscuz.conf;
修改为
includediscuzx25.conf;
保存后,重启Nginx或LNMP:
lnmprestart
注:以上是lnmp1.2下的操作。
热门推荐
2 成都训练狗狗
3 怎么训练小狗狗
4 训练狗狗软件
5 如何训练狗狗拉屎
9 狗狗负重训练
10 狗狗多大可以训练大小便
11 怎么训练狗狗萨摩耶
12 狗狗训练书
13 鞍山狗狗训练
14 训练狗狗用品
15 怎样才能训练狗狗听话
16 狗狗如何训练大小便
17 怎样训练狗狗睡狗窝
18 训练狗狗工具