When you host a webpage, e.g., https://mydomain.example
and .htaccess
already takes care of the rewrite from www to without www and from http to https and it is also rewriting with RewriteRule ^$ https://mydomain.example/en/page1.html [R=301,L]
to
https://mydomain.example/en/page1.html
(this file obviously holds the actual HTML code) and you have also other pages https://mydomain.example/en/page2.html
, https://mydomain.example/en/page3.html
etc.
and a similar set of pages for another language
https://mydomain.example/de/page1.html
(with just the same content in e.g. german language), https://mydomain.example/de/page2.html
, https://mydomain.example/de/page3.html
etc.
then Google gives some advice in Tell Google about localized versions of your page.
I did that, but I did not figure out whether I should keep https://mydomain.example
and / or https://mydomain.example/en/page1.html
in my sitemap.
Now the incoming external backlinks all point to https://mydomain.example
. This is the reason why I put <link rel="canonical" href="https://mydomain.example">
in the header of https://mydomain.example/en/page1.html
The google search console indexed https://mydomain.example
correctly and put https://mydomain.example/en/page1.html
into the not indexed category due to Duplicate without user-selected canonical. It has meanwhile also disappeared from there.
Only recently google chrome lighthouse has added a SEO error for my setup "Document does not have a valid rel=canonicalPoints to the domain's root URL (the homepage), instead of an equivalent page of content".
Should https://mydomain.example
and https://mydomain.example/en/page1.html
both be in my sitemap?
Also, should I
a.) change the setup to make https://mydomain.example/en/page1.html
my canoncial page? or
b.) to make https://mydomain.example/en/
my canonical startup and work with a DirectoryIndex to point to page1.html
? or
c.) leave https://mydomain.example
as the canonical page since the incoming links go there?
Please note that I found a relevant answer to my question (see below), but it is very old and the accepted answer was never upvoted, so I am unsure if it (still) applies:
Edit: Trying to make my question more clear I made substantial edit. Sorry for any invonvenience caused.