Home > Mobile >  Sitemap getting altered on submission to heroku
Sitemap getting altered on submission to heroku

Time:06-18

I have a website with multiple languages being hosted with Heroku. My sitemap is in the public folder like it's supposed to be, but the format is getting simplified by Heroku such that the sitemap on my website doesn't actually distinguish between different hreflang versions anymore. For example, my actual sitemap starts like this:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
  xmlns:xhtml="http://www.w3.org/1999/xhtml">
  <url>
    <loc>https://example.com/</loc>
    <xhtml:link
               rel="alternate"
               hreflang="en"
               href="https://example.com/"/>
    <xhtml:link
               rel="alternate"
               hreflang="fr"
               href="https://example.com/fr"/>
  </url>

But when you look at https://example.com/sitemap.xml, it just shows a basic text file like this:

https://example.com/ https://example.com/fr

So you can't tell which one is the primary one anymore. Since this isn't the format that I'm writing the sitemap in, I don't see what I can do to avoid it.

For reference, I write my xml sitemap by hand based on Google's example given here, about halfway down the page.

CodePudding user response:

It turns out that my issue was just that my browser was trying to render the xml by default, instead of just showing what the file looks like. So this was not actually a problem.

  • Related