Next.js Discord

Discord Forum

Localised sitemap and SEO

Unanswered
Cape lion posted this in #help-forum
Open in Discord
Cape lionOP
So I'm looking for the best pattern to follow to create a sitemap and have all pages indexed on Google.
I got an internationalised site with, say, example.com/en/test and example.com/es/test and the base example.com/test would redirect to either one of the previous paths depending on user's accept-language headers or cookie or other preferences.

I checked Google Search Central and found this post > https://developers.google.com/search/blog/2012/05/multilingual-and-multinational-site
But was wondering if anyone has any insight or hands-on experience on this matter?


Initially, I thought that this below would be the best practice:
<url>
  <loc>https://www.example.com/test</loc>
  <xhtml:link
    rel="alternate"
    hreflang="de"
    href="https://www.example.com/de/test" />
  <xhtml:link
    rel="alternate"
    hreflang="en"
    href="https://www.example.com/en/test" />
</url>

But apparently, since example.com/test throws in my case a 307 redirect, Google will struggle to index the path, or at least that's what I encountered in my experience.

Any advice is welcome 🙂

0 Replies