所有分类
  • 所有分类

  • Warning: Attempt to read property "name" on null in /www/wwwroot/xdyl.club/wp-content/themes/modown/header.php on line 289

Discuz!教程之删除版块和帖子后地址非404页面的解决方法

很多站长因为删除内容违规版块和帖子,出现被收录删除的帖子返回200状态码,进入提示“抱歉,指定的主题不存在或已被删除或正在被审核”,那如何才能使用帖子被删除后跳转至404页面,也就是帖子被删除返回404状态码呢?下面分享下解决方法:

找到文件:source/module/forum/forum_forumdisplay.php中的:

showmessage(‘forum_nonexistence’, NULL);

找到文件:source\module\forum\forum_viewthread.php中的:
showmessage(‘thread_nonexistence’);

都替换为:

header('status: 404 Not Found');
include('404.html');
exit();

404.html是你定义的404页面,路径你自己决定。
然后你就能解决,帖子被删除或者被审核,然后能跳转至404页面了,更有利于搜索引擎优化。

阅读全文
原文链接:https://xdyl.club/1956,转载请注明出处~~~
0

评论0

显示验证码
没有账号?注册  忘记密码?

社交账号快速登录

微信扫一扫关注
如已关注,请回复“登录”二字获取验证码