『抱歉,指定的主題不存在』 如何設定成 404 頁面
網上找過了很多方法。都不行。
方法如下:
Discuz! x2.5/X3 的解決辦法如下:
找到檔案:source/module/forum/forum_viewthread.php 中的:
showmessage('thread_nonexistence');

替換為:
header('HTTP/1.1 404 Not Found');
header('status: 404 Not Found');
include('404.html');
exit();

或者直接跳轉到 404 頁面
dheader("Location: 404.html");
複製程式碼
建議使用第一種方法來實現更有利於搜尋引擎最佳化。