Reputation: 103
I'm setting up a multi-language page and I want to use the new TYPO3 v9 on-board sitemap generation feature. I read the TYPO3 docs and set up a sitemap generation config for pages.
Now I can request https://example.com/sitemap.xml
- this gives me a sitemap-index file with one entry that is pointing to a valid sitemap.xml file, but I cannot see any of the other languages.
It is possible to request https://example.com/EN/sitemap.xml
also and I could add more Sitemap:
directives to robots.txt, but is that correct?
Can somebody give me a hint how to configure TYPO3 sitemap feature for multiple languages within my typoscript setup?
Best regards, Lex
BTW: I'm using <link rel="alternate" hreflang="en" href="https://example.com/en/">
in HTML head area, also.
Upvotes: 1
Views: 3270
Reputation: 1476
If your language setup is correct, the sitemap will be generated for each language automatically.
In your site config (yaml) --> config/sites/your_site/config.yaml
Language configuration (example)
languages:
-
title: English
enabled: true
languageId: '0'
base: /
typo3Language: en
locale: en
....
-
title:
enabled: true
languageId: '1'
base: /sv/
typo3Language: sv
locale: sv_SE
....
Would result in two languages on the same domain, with a path per language
If you want to use domains instead of a path (e.g. domain-1.xy for language 1 and domain-2.xy for language 2), you have to set the base url in your yaml config for each language.
For rewriting the sitemap:
routeEnhancers:
PageTypeSuffix:
type: PageType
limitToPages:
- 1
map:
sitemap.xml: 1533906435
This would result that the sitemap(s) are accessible with a rewritten url, limited to page with ID 1.
So to generate a sitemap per language, you need to:
Upvotes: 4