We have a need for the Drupal sitemap to not exist on sitemap.xml, but instead on something like "sitemap_other.xml".
I went to URL Alias and setup an alias for sitemap.xml > sitemap_other.xml. This worked fine; The overview page (admin/config/search/xmlsitemap) respects it and links to the new URL and Drupal serves the XML file when I request it.
However the paginated index is incorrect:
<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap><loc>https://www.example.com/sitemap.xml?page=1</loc><lastmod>2019-11-22T09:22Z</lastmod></sitemap>
<sitemap><loc>https://www.example.com/sitemap.xml?page=2</loc><lastmod>2019-11-22T09:22Z</lastmod></sitemap>
</sitemapindex>
Those URLs do not respect the alias.
Comments
Comment #2
nicholasthompsonSo I think this is the relevant code (in xmlsitemap.xmlsitemap.inc)...
Then...
Why do we set alias to TRUE?
> 'alias': Defaults to FALSE. Whether the given path is a URL alias already.
It feels like this shouldn't be set?
Comment #3
nicholasthompsonThis seems to fix the problem for us.
However I dont know why that was ever set in the first place?