Création des Logiciels de gestion d'Entreprise, Création et référencement des sites web, Réseaux et Maintenance, Conception
Création des Logiciels de gestion d'Entreprise, Création et référencement des sites web, Réseaux et Maintenance, Conception
Update: This markup can now be used for multilingual and multi-regional content in general. More information.
<link rel=”alternate” hreflang="a-different-language" href="http://url-of-the-different-language-page" />
rel=”alternate” hreflang=”x”
is included in conjunction with rel=”canonical”
or 301s, not only will our indexing and linking properties be more accurate, but we can better serve users the URL of their preferred language.rel=”alternate” hreflang=”x”
Step 1: Select the proper canonical.Once the steps are completed, the configuration on “The Network” would look like this:
The canonical designates the version of your content you’d like indexed and returned to users.The first step towards making the right content indexable is to pick one canonical URL that best reflects the genuine locale of the page’s main content. In the example above, since Javier is a Spanish-speaking user and he created his profile on es.example.com, http://es.example.com/javier-lopez is the logical canonical. The title and snippet in all locales will be selected from the canonical URL.Step 2: In the canonical URL, specify the various language versions via the rel=”alternate” link tag, using its
Once you have the canonical URL picked out, you can either:A. 301 (permanent redirect) from the language variants to the canonical
As an example, if a French speaker visits fr.example.com/javier-lopez (not the canonical), have this page include a cookie to remember the user's language preference of French. Then permanently redirect from fr.example.com/javier-lopez to the canonical at es.example.com/javier-lopez. Because of the cookie, es.example.com/javier-lopez will still render its boilerplate in French (even on the es.example.com subdomain!). Similarly, en.example.com/javier-lopez would set the value of this cookie to English and then 301 redirect to es.example.com/javier-lopez.
Including a language selection link is also helpful should a multilingual user prefer a different experience of your site.
B. Use rel=”canonical”
On the other language variants, include alink rel=”canonical”
tag pointing to your chosen canonical. In our example, since the canonical for Javier’s profile is the Spanish version, the English and French pages (and optionally even the Spanish page itself) would include<link rel=”canonical” href="http://es.example.com/javier-lopez" />
.
Cookies are not involved in this setup. Therefore, a French speaker will be served es.example.com/javier-lopez with a Spanish template. Implement step 2 if you want the French speakers to be served the French version at fr.example.com/javier-lopez in Google search results.hreflang
attribute.
rel=”alternate” URLs can be displayed in search results in accordance with a user’s language preference. The title and snippet, however, remain generated from the canonical URL (as is customary with rel=”canonical”), not from the content of any rel=”alternate”.You can help Google display the correctly localized variant of your URL to our international users by adding the following tags to http://es.example.com/javier-lopez, the selected canonical:<link rel=”alternate” hreflang="en" href="http://en.example.com/javier-lopez" />
<link rel=”alternate” hreflang="fr" href="http://fr.example.com/javier-lopez" />
rel=”alternate”
indicates that the URL contains an alternate version located at the URI of thehref
value.hreflang
identifies the language code of the alternate URL and can be specified with ISO-639.
Please note: If your site supports many languages and you’re worried about the increased file size when declaring numerous rel=”alternate” URLs, please see our Help Center article about configuring rel=”alternate” with file size constraints.
either 301s with a language cookie or contains <link rel=”canonical” href=”http://es.example.com/javier-lopez” />
either 301s with a language cookie or contains <link rel=”canonical” href=”http://es.example.com/javier-lopez” />
is the canonical and contains<link rel=”alternate” hreflang="en" href="http://en.example.com/javier-lopez" />
and<link rel=”alternate” hreflang="fr" href="http://fr.example.com/javier-lopez" />
rel=”canonical”
or a 301 redirect, we can cluster the language variations with the canonical. With rel=”alternate” hreflang=”x”
at serve-time we can deliver the URL of the most appropriate language to the user: English speakers will be served en.example.com/javier-lopez
as the result for the URL in Javier’s profile, French speakers will see fr.example.com/javier-lopez
, Spanish speakers will see es.example.com/javier-lopez
.es.example.com/javier-lopez
is the canonical, queries that include template content from this page, e.g. [Javier Lopez familia] -- when using any language preference -- may return his profile (content from the canonical version). On the other hand, queries that include template content of the “duplicate” version, e.g. [Javier Lopez family], are less likely to return his profile page. If you would like the other language versions indexed separately and searchable, avoid using rel=”canonical” and rel=”alternate”.hreflang
attribute. This way, Google can show the correctly-localized variant of your URLs to our international users.