One website, different domains for languages.
https://example.com — english version
https://example.ru — russian version
Add styling and sorting to sitemaps — checked. We want to see tables.
Rebuild & generate from UI.
Important: rebuild from the example.ru version:
https://example.ru/admin/config/search/simplesitemap
https://example.ru/sitemap.xml — OK.
But another language version link:
https://example.com/sitemap.xml — will not be displayed.
It's because of the XSL url inside sitemap.xml:
<?xml-stylesheet type="text/xsl" href="https://example.ru/sitemap.xsl"?>
XSL link always points to the language version from which the generation was made.
In chrome dev tools console we'll see:
Unsafe attempt to load URL https://example.ru/sitemap.xsl from frame with URL https://example.com/sitemap.xml. Domains, protocols and ports must match.
...
In addition, it is not clear, how to handle such situation from cron and drush via:
drush simple-sitemap:rebuild-queue && drush cron
Comment | File | Size | Author |
---|---|---|---|
#2 | Disable-route-normalizer-8.x-3.x.patch | 741 bytes | cvikir |
Comments
Comment #2
cvikir CreditAttribution: cvikir as a volunteer and at Freely Agency commentedThis patch should help, you need to regenerate the sitemaps after apply
but this code is still regenerating url with lang prefix even that it should not :/
$xsl_url = Url::fromRoute('simple_sitemap.sitemap_xsl')->toString();
So if anybody knows how to make this code work without the languace prefix that redirect module adds please post your solution
here. Apparently adding
_disable_route_normalizer: 'TRUE'
is not a sufficent solution in this case.Comment #4
gbyte CreditAttribution: gbyte as a volunteer and at gbyte commentedThanks for looking into it! We use
_disable_route_normalizer
for other routes already.I've looked, but haven't found the answer. Do you think the erroneous stylesheet definition here might cause further problems?