Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

172
Vistas
Javascript location.href redirection after a timeout: do search engine crawlers consider it as a redirect?

Let's say I have example.com/fr/article123 (in french). If the browser-language is not french, I do a redirection to example.com/article123 (in english) with:

<script>
setTimeout(function() { location.href = "example.com/article123" }, 100);
</script>

I know that nowadays search engine crawlers execute JavaScript up to a few seconds.

Question: as of 2021, will example.com/fr/article123 be indexed by GoogleBot on its own, or be considered a 302-redirection of example.com/article123 and therefore not be indexed?

If it is the latter, does this mean that nowadays "automatic redirection to browser language", even when done carefully (see note after), either by PHP or JavaScript, is totally obsolete? Is there no way to do it anymore, if we want to be search-engine-friendly?

Notes:

  • I only do this under certain conditions: only once with cookies (an english-language user may want to visit the french website after all, so I only try to redirect them once), only if cookies are accepted by browser, etc. I added these conditions carefully, and my tests show it's usually good for user experience.

  • I first did the redirection with PHP header('Location: ...'); but then I noticed That GoogleSearchConsole and AhrefsSiteAuditTool considered that example.com/fr/article123 is a 302 redirection and therefore not indexed, and that example.com/article123 is its canonical URL (bypassing my <link rel="canonical" href="example.com/fr/article123">), conclusion: it's bad. More info about the PHP solution here: Search engine crawlers get redirected to English pages (and thus avoid other languages' pages) with a multilingual website.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda