I have a website that has two versions:
link :
<link rel="alternate" hreflang="en" href="http://www.example.com/en/" />
<link rel="canonical" hreflang="es" href="http://www.example.com/" />
And the url link :
<link rel="alternate" hreflang="es" href="http://www.example.com/" />
<link rel="canonical" hreflang="es" href="http://www.example.com/" />
I know that I am setting the labels wrong, but I can not understand the logic that the alternate / canonical / hreflang follows for correct marking for SEO. In this case, how would you have to face the marking better? Is it enough to do it in the sitemap.xml for search engines? Ejm.:
...
<url>
<loc>http://www.example.com/</loc>
<xhtml:link
rel="canonical"
hreflang="es"
href="http://www.example.com/"
/>
<xhtml:link
rel="alternate"
hreflang="en"
href="http://www.example.com/en/"
/>
</url>
<url>
<loc>http://www.example.com/en/</loc>
<xhtml:link
rel="canonical"
hreflang="es"
href="http://www.example.com/"
/>
<xhtml:link
rel="alternate"
hreflang="en"
href="http://www.example.com/en/"
/>
</url>
...