打開 LNMP 偽靜態(tài)文件目錄:
復(fù)制代碼 代碼如下:
cd /usr/local/nginx/conf新建并編輯 discuzx25.conf 文件:
復(fù)制代碼 代碼如下:
vi discuzx25.conf按 i 進(jìn)入編輯模式,添加下面的代碼:
復(fù)制代碼 代碼如下:
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 保存退出。
然后進(jìn)入網(wǎng)站配置文件目錄:
復(fù)制代碼 代碼如下:cd /usr/local/nginx/conf/vhost編輯對(duì)應(yīng)的網(wǎng)站配置文件,比如 aaa.com.conf復(fù)制代碼 代碼如下:vi aaa.com.conf找到配置中的復(fù)制代碼 代碼如下:include discuz.conf;修改為復(fù)制代碼 代碼如下:include discuzx25.conf;保存后,重啟 Nginx或LNMP:復(fù)制代碼 代碼如下:lnmp restart注:以上是 lnmp 1.2 下的操作。新聞熱點(diǎn)
疑難解答
圖片精選
網(wǎng)友關(guān)注