首页 > 解决方案 > Codeigniter 日志中出现奇怪的 404 错误

问题描述

在过去一周左右的时间里,我注意到我在基于 Codeigniter 的网站上的日志中收到了很多奇怪的 404 错误。几个例子:

404 Page Not Found: Apple-touch-iconpng/index
404 Page Not Found: 404javascriptjs/index
404 Page Not Found: 404testpage4525d2fdc/index
404 Page Not Found: Faviconico/index

其中一些是存在的东西(apple-touch-icon.png),但是 404 错误缺少文件扩展名,并且后面有一个“/index”。其中一些是甚至不存在的文件(404testpage4525d2fdc)。我已经浏览了整个站点以寻找损坏的链接,但没有。我也没有在实际站点上显示任何 404 错误 - 只是在日志中。

我的 .htaccess 文件:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]

我的路线文件:

$route['default_controller'] = 'welcome';
$route['404_override'] = '';
$route['translate_uri_dashes'] = FALSE;
$route[LOGIN_PAGE] = 'users/login';
$route['landlords'] = 'listings/directory/1';
$route['complexes'] = 'listings/directory/2';
$route['managers'] = 'listings/directory/3';
$route['apartments/sublets'] = 'listings/index/13';
$route['apartments/roommates/19'] = 'listings/index/19';
$route['apartments/roommates/20'] = 'listings/index/20';
$route['apartments/roommates/21'] = 'listings/index/21';
$route['apartments/roommates/22'] = 'listings/index/22';
$route['apartments/roommates'] = 'listings/index/14';
$route['apartments/listings'] = 'listings/index/15';
$route['apartment-alerts'] = 'notification/add_notification';
$route['apartments/listings/([0-9]-(beds))'] = 'listings/index/$1';

就像我说的那样,该站​​点本身似乎运行良好,但我无法弄清楚是什么导致这些错误出现在日志中。我试过寻找答案,但他们似乎都在处理网站上出现的 404 错误,并且是应该在服务器上的实际资源。任何帮助将不胜感激!

标签: phpcodeigniter

解决方案


就我在过去 20 分钟的研究中能够弄清楚的情况而言,404testpage4525d2fdc似乎404javascript.js是扫描仪要求检查恶意行为的,尤其是在使用 WordPress 的网站上。/index(我猜你的重写规则是从任何不存在的请求文件中删除句点并附加到其中。)

一种这样的扫描仪是 Securi。通过https://sitecheck.sucuri.net/results/www.example.com检查您的网站,然后立即检查您的访问日志,您可能会看到其中一个或两个位置的新条目。

其他网络爬虫(可能是搜索引擎)正在尝试从您的网站检索Apple-touch-icon.pngFavicon.ico获取徽标。


推荐阅读