0) foreach ($banned as $bannedstr) if (strpos($uri, $bannedstr)!==false) { $bannedfl = true; break; } if ($redir404 AND parse_url($_SERVER['HTTP_REFERER'], PHP_URL_HOST)!==$_SERVER['SERVER_NAME'] AND !$bannedfl) { header("HTTP/1.1 301 Moved Permanently"); header('Location: https://'.$_SERVER['SERVER_NAME'].'/'); exit(); } header("HTTP/1.1 404 Not Found"); $langtemp = substr($uri, 1, 4); if (substr($langtemp, 0, 1)==='/' AND substr($langtemp, 3, 1)==='/') { $lang = substr($langtemp, 1, 2); if (is_file($lang.'/404.html')) { $content = file_get_contents($lang.'/404.html'); } else $content = file_get_contents("404.html"); } else $content = file_get_contents("404.html"); $str404 = preg_replace('/[^ a-zа-яё\d]/ui', ' ', urldecode($_SERVER['REQUEST_URI'])); $content = preg_replace("/\(.*?)\<\/title\>/i","Nothing found for $str404", $content); $contenthtml = true; } if (is_file('./svg-icons.svg')) $inc01 = file_get_contents('./svg-icons.svg'); if (strpos($content, '')!==false) $content = str_replace('', $inc01, $content); $arr1 = [' ','','','','','','','','','','','']; $arr2 = [ ' ', //hdr '', //ftr '', //ad01 '', //ad02 '', //ad03 '', //ad04 '', //ad05 '', //ad06 '', //ad07 '', //ad08 '', //ad09 '' //ad10 ]; // на главной: if ($uri==='./' OR $uri==='./index.php') { $arr2[0] = ''; } $liru = ''; /*$liru = '';*/ $stmob = ''; /* $stmob = 'Open

' . '' . // прилипашка для мобильного '

Close
'; */ $stdsk = ''; /* $stdsk = '
' . '' . //прилипашка для десктопа '
'; */ if ( empty($_SERVER['HTTP_USER_AGENT']) ) { $is_mobile = false; } elseif ( strpos($_SERVER['HTTP_USER_AGENT'], 'Mobile') !== false // many mobile devices (all iPhone, iPad, etc.) || strpos($_SERVER['HTTP_USER_AGENT'], 'Android') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'Silk/') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'Kindle') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'BlackBerry') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'Opera Mini') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'Opera Mobi') !== false ) { $is_mobile = true; } else { $is_mobile = false; } if ($is_mobile) { $content = str_replace('', '', $content); $arr2[1] .= $stmob; } else { $content = str_replace('', $stdsk, $content); } $content = str_replace($arr1, $arr2, $content); $content = str_replace('', $liru, $content); if ($contenthtml) header("Content-type: text/html; charset=UTF-8"); header('link: ; rel="https://api.w.org/"'); if (strpos($content, "0) header('link: <'.$short.'>; rel=shortlink'); } header('cache-control: no-cache, must-revalidate, max-age=0'); header('expires: Wed, 11 Jan 1984 05:00:00 GMT'); echo $content; return; ?>