> ## Documentation Index
> Fetch the complete documentation index at: https://omniloy.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Omniloy

> Documentación oficial de Omniloy

export const Redirect = () => {
  React.useEffect(() => {
    if (window.__OMNILOY_ROOT_REDIRECT_INVOKED__) return;
    window.__OMNILOY_ROOT_REDIRECT_INVOKED__ = true;
    (function () {
      var l = (localStorage.getItem('language') || navigator.language || 'es').split('-')[0];
      var p = String(window.location.pathname || '/');
      var bp = '';
      if (!(/^\/(sofia|home|maria|omnicare|en|es)(\/|$)/).test(p)) {
        var markers = ['/sofia/', '/home/', '/maria/', '/omnicare/', '/en/', '/es/'];
        var cut = -1;
        for (var i = 0; i < markers.length; i++) {
          var idx = p.indexOf(markers[i]);
          if (idx > 0 && (cut === -1 || idx < cut)) cut = idx;
        }
        if (cut > 0) {
          bp = p.slice(0, cut).replace(/\/+$/, '');
          if (bp && bp.charAt(0) !== '/') bp = '/' + bp;
        }
      }
      window.location.replace(bp + '/home/' + (l === 'en' ? 'en' : 'es') + '/home');
    })();
  }, []);
  return null;
};

<Redirect />
