4

I have a good search-engine ranked webpage written in Dutch (=NL) and I have just upgraded my site to be in French too. So I've created subdirectories for NL and FR, but my root/index is now exactly the same as my /root/nl/index page… So I 302-redirect from my root/index to the correct subdir based on browser language. Is this the good way? (thinking about SEO and knowing my root/index has a good rating). But my biggest question is, how to handle the hreflang, canonical, maybe even x-default…

Here is my code:

MY FILENAME: root/index.html (= https://example.com/)

<html lang="nl-be">
<head>
<link rel="canonical" href="https://example.com/" /> 
<link rel="alternate" hreflang="nl-BE" href="https://example.com/nl/" /> 
<link rel="alternate" hreflang="fr-BE" href="https://example.com/fr/" /> 
----------------------------------------------------------------------
MY FILENAME: root/nl/index.html (= https://example.com/nl/)

<html lang="nl-be">
<head>
<link rel="canonical" href="https://example.com/" /> 
<link rel="alternate" hreflang="nl-BE" href="https://example.com/nl/" />
<link rel="alternate" hreflang="fr-BE" href="https://example.com/fr/" />

Is this correct? Should it be different?

1

I am quite new to multi-lingual websites, but after reading this article, I would go like this:

example.com/:

  • if the content is the same at example.com/ and at example.com/nl/:
<html lang="nl-BE">
<head>
<link rel="canonical" href="https://example.com/nl/">
<link rel="alternate" hreflang="nl-BE" href="https://example.com/nl/">
<link rel="alternate" hreflang="fr-BE" href="https://example.com/fr/">
  • if it is an international page:
<html lang="en-GB">
<head>
<link rel="canonical" href="https://example.com/">
<link rel="alternate" hreflang="x-default" href="https://example.com/">
<link rel="alternate" hreflang="nl-BE" href="https://example.com/nl/">
<link rel="alternate" hreflang="fr-BE" href="https://example.com/fr/">

example.com/nl/:

<html lang="nl-BE">
<head>
<link rel="canonical" href="https://example.com/nl/">
<link rel="alternate" hreflang="nl-BE" href="https://example.com/nl/">
<link rel="alternate" hreflang="fr-BE" href="https://example.com/fr/">

example.com/fr/:

<html lang="fr-BE">
<head>
<link rel="canonical" href="https://example.com/fr/">
<link rel="alternate" hreflang="fr-BE" href="https://example.com/fr/">
<link rel="alternate" hreflang="nl-BE" href="https://example.com/nl/">

Also,

I would keep the 302 redirection from example.com/ to example.com/nl/ or example.com/fr/ based on the browser language.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.