dz!x优化板块信息和帖子不存在时返回404错误

[复制链接]
查看3684 | 回复0 | 2020-3-2 15:55 | 显示全部楼层 |阅读模式
dz!x优化板块信息和帖子不存在时返回404错误
在:source/function/function_message.php
查找:  
  1. $_G['hookscriptmessage'] = $message;
复制代码
上面加入:
  1.   if(strpos($message,'nonexistence') !== false || strpos($message,'noexist') !== false || strpos($message,'not_exist') !== false || strpos($message,'nofound') !== false || strpos($message,'no_found') !== false || strpos($message,'not_found') !== false){
  2.               header('HTTP/1.1 404 Not Found');
  3.         header('status: 404 Not Found');
  4.               include('err404.htm');
  5.          exit();
  6.     }
复制代码
上传覆盖,刷新一个不存在的板块,就会出现404页面提示,而不是系统的板块不存在提示了。如果是帖子需要404,则修改:source\module\forum\forum_viewthread.php
查找:
  1. $page = max(1, $_G['page']);
复制代码
在上面加入:
  1. if(!$_G['forum_thread'] || !$_G['forum']) {
  2.         header('HTTP/1.1 404 Not Found');
  3.         
  4. header('status: 404 Not Found');
  5.         
  6. include('err404.htm');
  7. exit();
  8. }
复制代码
后台更新缓存就可以了。
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

UID
1
贡献
387
丢币
38902
主题
4607
回帖
116
注册时间
2018-9-25
最后登录
2024-4-16