I have a website that uses country-specific pages. So for every page, there is a country-specific URL. For example: example.com/au/blog
, example.com/us/blog
, example.com/uk/blog
. This is great as we can show content more relevant to each country.
This idea is the same for our home page: example.com/au
, example.com/us
, example.com/uk
.
When a user goes to a non-country specific URL (ie example.com
, example.com/blog
) the server falls back to serving more generalised content. On the client, we then show a banner for the user to decide if they want to go to a country-specific page.
With this in mind, I have added the following meta tags and receiving the below error when testing using Lighthouse.
<link rel="canonical" href="https://www.example.com/">
<link rel="alternate" hreflang="x-default" href="https://www.example.com/">
<link rel="alternate" hreflang="en-GB" href="https://www.example.comt/uk/">
<link rel="alternate" hreflang="en-US" href="https://www.example.com/us/">
<link rel="alternate" hreflang="en-AU" href="https://www.example.com/au/">
//error
The document does not have a valid rel=canonical. Points to the domain's root URL (the homepage), instead of an equivalent page of content.
Is this the correct way to inform crawlers that:
- The site root is the original document
- The site root doesn't target any language or locale
- The alternatives to this page are en-GB, en-US and en-AU
If so, why does Lighthouse complain about this error on the home page? It doesn't complain about this on any other page.
I am new to canonicalisation and providing alternative lang pages so I might be missing something obvious.