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

CommentFileSizeAuthor
#2 Disable-route-normalizer-8.x-3.x.patch741 bytescvikir
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

alexdoronin created an issue. See original summary.

cvikir’s picture

This 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.

  • gbyte.co committed 178a232 on 8.x-3.x
    Issue #3082387 by gbyte.co, cvikir: Incorrect XSL links for different...
gbyte’s picture

Version: 8.x-3.3 » 8.x-3.x-dev
Status: Active » Fixed

Thanks for looking into it! We use _disable_route_normalizer for other routes already.

but this code is still regenerating url with lang prefix even that it should not :/

I've looked, but haven't found the answer. Do you think the erroneous stylesheet definition here might cause further problems?

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.