discuz教程:提示\'抱歉,指定的主题不存在\'如何设置成404
发布时间:12/03 来源: 浏览:
关键词:
网上找过了很多方法。都不行。
方法如下:
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");
复制代码
建议使用第一种方法来实现更有利于搜索引擎优化。