0) { $url2 = substr($url2, 0, -1); $ext = substr($url2, -4); if ((('.htm' == $ext) || ('.php' == $ext)) && file_exists($root . $url2)) { header('Location: http://www.balagurov.com' . $url2); exit; } if (0 == strcmp(substr($url2, -1), '/')) { break; } } // fixes an error with cyrillic characters instead of latin ones $url2 = $url; $url2 = str_replace('%D0%B0', 'a', $url2); $url2 = str_replace('%D0%B5', 'e', $url2); $url2 = str_replace('%D0%BE', 'o', $url2); $url2 = str_replace('%D1%80', 'p', $url2); $url2 = str_replace('%D1%81', 'c', $url2); if (file_exists($root . $url2)) { header('Location: http://www.balagurov.com' . $url2); exit; } // don't send mail if error is caused by some bots, as they have bugs that generate a lot of 404 errors // http://www.majestic12.co.uk/bot.php // http://ip-web-crawler.com/ // http://www.linguee.com/bot // https://www.Datadio.com $userAgent = $_SERVER['HTTP_USER_AGENT']; if ((strlen($userAgent) > 0) and ( (strpos($userAgent, 'MJ12bot') !== false) or (strpos($userAgent, 'ip-web-crawler.com') !== false) or (strpos($userAgent, 'linguee.com') !== false) or (strpos($userAgent, 'DioScout') !== false) ) ) { $nomail = true; } else { $nomail = false; } $nomail = true; // TODO: remove $error = 404; $title = '������ 404 - �������� �� �������'; $explanation = '� ���������, �������� � ����� ������� �� ����������.'; require('template.php'); ?>