Problem/Motivation

Having project with many different domains and need to generate different sitemap for each domain.
Project is not multisite, domains are set as language versions.

See: https://stackoverflow.com/questions/6426725/sitemap-for-multiple-domains...

How can I reach such result with benefit of autogeneration of sitemap.xml?

site1.com/sitemap.xml
site1.de/sitemap.xml
site1.es/sitemap.xml

So site1.com/sitemap.xml does not share records for site1.de/sitemap.xml or site1.es/sitemap.xml

site1.com/sitemap.xml should not contain records with site1.de domain or records with site1.es domain.

Comments

marianrk created an issue. See original summary.

gbyte’s picture

Version: 4.2.3 » 4.x-dev
Status: Needs work » Active

I think there are multiple issues in regards to this and I believe we don't have a perfect solution. Can you please search these issues and if you find them link them here and close this here issue?

marianrk’s picture

I did searched for similar issues, but did not find anything yet.

What I see rendered now. And what I see recommended to have does not have many differences.
Only needed is truly to filter out render by langcode.
Make render for each lang version and serve result to correct path domain.xx/sitemap.xml

Render probably is simple to solve, so only serving to correct output url path with correct domain.

I will look forward to mentioned issues.

What should be rendered (case project.de/sitemap.xml) :


https://projekt.de/
rel="alternate"
hreflang="de"
href="https://projekt.de/" />
rel="alternate"
hreflang="en"
href="https://project.com/" />
rel="alternate"
hreflang="x-default"
href="https://project.com/" />

This record is duplicity for project.de/sitemap.xml (module doing it now)


https://projekt.com/
rel="alternate"
hreflang="de"
href="https://projekt.de/" />
rel="alternate"
hreflang="en"
href="https://project.com/" />
rel="alternate"
hreflang="x-default"
href="https://project.com/" />

Also module dont render x-default xhtml:link record

There exists module for serving - Serve plain files

marianrk’s picture

5 years OLD issue recommending different module that depends on yet another module and modules have security issues
https://www.drupal.org/project/simple_sitemap/issues/3036691

Aged issue (lang subdomains) - Rejected as Multisite implementation
https://www.drupal.org/project/simple_sitemap/issues/2938777

I didnt find any issue for core Drupal project with use of different domain for each language.
So instead of project.com/en
project.com/de

There is used for en lang: project.com, for de lang: project.de

And it is not multisite installation either.

Its is not either needed extra module like domains. Its core feature have extra domains for each language. Just configuration.

kenwest’s picture

@marianrk - try the domain_simple_sitemap module