推荐应用
Discuz x2.5及2.0删帖后地址返回200状态码的解决方法
发布于 2013-02-07
很多站长因为删除内容违规帖子,出现被收录删除的帖子返回200状态码,不能从百度收录中清楚,那如何才能使用Discuz! X2.5 帖子被删除后跳转至404,也就是帖子被删除返回404状态码呢?下面分享下解决方法:
Discuz! X2.5 的解决办法如下:
找到文件:source\module\forum\forum_viewthread.php中的:
查找文件 \source\module\forum\forum_viewthread.php中搜索
dheader("Location: 404.html");
404.html是你定义的404页面,路径你自己决定。
然后你就能解决,帖子被删除或者被审核,然后能跳转至404页面了。
Discuz! X2.5 的解决办法如下:
找到文件:source\module\forum\forum_viewthread.php中的:
showmessage('thread_nonexistence');
替换为:header('HTTP/1.1 404 Not Found');
header('status: 404 Not Found');
exit();
或者直接跳转到404页面dheader("Location: 404.html");
Discuz! X2.0 的解决办法如下:查找文件 \source\module\forum\forum_viewthread.php中搜索
my_thread_log('redelete', array('tid' => $_G['gp_tid']));
然后在下面添加这行代码dheader("Location: 404.html");
404.html是你定义的404页面,路径你自己决定。
然后你就能解决,帖子被删除或者被审核,然后能跳转至404页面了。