When having a prefixed default language on /admin/config/regional/language/detection/url, the generated links on the sitemap status page are prefixed as well, which is wrong, as the sitemap routes are normalized.

Comments

FvD created an issue. See original summary.

gbyte’s picture

Category: Bug report » Support request

That's unlikely a bug. Have you read the documentation/readme? You need to set up a sitemap first and include content that is published. If the sitemap is empty after generation, it will throw a 404.

fvd’s picture

Hello @gbyte,

the steps who I have done:

create a sitemap. Path: admin/config/search/simplesitemap/variants/add
(content is there.)
add content entities. Path: admin/config/search/simplesitemap/entities
save with create all sitemaps new.
now, I can see the links there: admin/config/search/simplesitemap

But, if I want to go to the sitemap, example.com/xxx/sitemap.xml

But none link in the sitemap files, the site is empty. (not 404)

also the default. Path example.com/sitemap.xml

gbyte’s picture

The sitemap is probably there, press ctrl+u to see it. What does not seem to be working for you is sitemap styling (irrelevant for the functionality). You can disable the sitemap style in the settings. It is strange however that you are the second person to log this: #3371572: Sitemap file doesn't show when any user is logged.

gbyte’s picture

I created a test project with D10.1 and simple_sitemap 4.1.6. No problem here. Can you please try and make this error reproducible on a fresh Drupal instance?

fvd’s picture

ctrl+u (option+u) doesn't work for me.

The sitemaps are not createt, because in: admin/reports/page-not-found are listet...

thank you for test project, the sitemap is there.

I think about the reproducible for you

fvd’s picture

StatusFileSize
new27.37 KB
gbyte’s picture

Why 'de-DE'? Is this a sitemap variant set up within the module? Or is it any type of Drupal translation functionality? These sitemaps are not supposed to be divided into language domains but to have all language variants within one sitemap (e.g. /sitemap.xml).

fvd’s picture

de-DE is the sitemap variant with the modul, yes. I use tmgmt modul for other languages.

hmm,

The sitemap is created.

on the normal path example.com/sitemap.xml?page=5
I think all sites are there!

But, what make the Path de-DE and break the sitemap links?

@gbyte, is the sitemap the right sitemap, with the language path or without?

fvd’s picture

If I delete the language path in the global sitemap, there are the sites...

Without the Language Path 😕

fvd’s picture

Reproduce:
Install D10.1.0 (Standard Installation)
Install simple XML Sitemap 4.1.6; tmgmt 1.15

Aktivate all

add a language admin/config/regional/language

configure the language pathes admin/config/regional/language

now press on Standard sitemap at admin/config/search/simplesitemap

The sitemap is't there.

The sitemap module leades to domain: example.com/LANGUAGE/sitemap.xml

But, the sitemap is at example.com/sitemap.xml

I dont know, is that a thing from simple XML Sitemap, or from tmgmt modul...

gbyte’s picture

I dont know, is that a thing from simple XML Sitemap, or from tmgmt modul...

If you don't know, how about disabling that module and checking? ;)

fvd’s picture

StatusFileSize
new45.05 KB

Now it is deactivated, and it is the same.

The sitemap from example.com/de-DE/admin/config/search/simplesitemap
Link to example.com/de-DE/sitemap.xml

But the sitemap is there: example.com/sitemap.xml

Maybe something in core modules, from the image?

gbyte’s picture

Your screenshot looks fine. Did you remember to regenerate the sitemaps after uninstalling that module?

de-DE is the sitemap variant with the modul, yes. I use tmgmt modul for other languages.

If I understand you correctly, you created a Sitemap variant 'de-DE' in order to have a language specific variant. This is wrong and may break if 'de-DE' is already a language prefix. Delete the variant and *only* use the default variant located under /sitemap.xml. This module creates hreflang sitemaps which means there is only supposed to be one sitemap irrespective of the number of languages. Variants are a functionality to categorize the site's content not for creating language sitemaps.

fvd’s picture

StatusFileSize
new89.05 KB

Is it, if I install drupal, with a different language than standard, then is something with the sitemap path. The add image have German, with path de, the Installation language.

Behind the installation I change the path to de-DE.

If I understand you right:

Simple XML sitemap modul needs, the "example.com" language as standard. If you need for your site that path or not.

If I change that "path" and Language, to example.com/de-DE/, then came what I have?

gbyte’s picture

I feel like our conversation would profit from Google Translate. Can you show me a screenshot of /admin/config/search/simplesitemap?

gbyte’s picture

Title: don't create a sitemap » Sitema link wrong on /admin/config/search/simplesitemap for prefixed default language
Version: 4.1.6 » 4.x-dev
Category: Support request » Bug report
Issue summary: View changes

No worries, I could reproduce the issue. This is only a cosmetic problem, as the sitemap exists under /sitemap.xml. Will look into it soon.

gbyte’s picture

Title: Sitema link wrong on /admin/config/search/simplesitemap for prefixed default language » Sitemap link wrong on /admin/config/search/simplesitemap for prefixed default language
fvd’s picture

StatusFileSize
new433.89 KB

Here is the image of the page /admin/config/search/simplesitemap

fvd’s picture

#15 Translatet:

If I understand correctly, drupal requires the example.com path for the system.

I can't change it afterwards to example.com/de-DE. Because otherwise there are problems with, among other things. simple xml sitemap.

Simple XML Sitemap claims the example.com path directly.

fvd’s picture

Hello gbyte,

Now it's working.

What I did:
reinstalling drupal example.com/
Then I created the languages.
And left the language of example.com/
in the path: /admin/config/regional/language/detection/url
unoccupied. I do not overwrite the English there! So example.com/
Then I created languages, including de-DE

Now the sitemap is delivered correctly.
example.com/sitemap.xml
Now the German path is in /sitemap.xml

Runs

fvd’s picture

Thank's for your help

yevko’s picture

Hello @gbyte,

I can confirm the issue listed here.

When a language prefix is set to the default language of the site,
language settings

links of the paginated sitemap get a prefix included as well:, when they shouldn't
sitemaps

The last screenshot is from the https://xxx.com/sitemap.xml page. When paginated links are assessed they go to 404 pages.

yevko’s picture

Update: This patch fixes the issue of excluding a language prefix from the paginated pages.

gbyte’s picture

Status: Active » Needs work

@YevKo thanks for the patch. It should not be necessary however, as we already do it inside SimpleSitemap::toUrl.

Can you double check if in fact your patch works?

gbyte’s picture

walkingdexter’s picture

Status: Needs work » Fixed

Just tested, all bugs reported here have been fixed in #3369919: Unexpected language prefixes on sitemap index

Status: Fixed » Closed (fixed)

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