- Issue created by @DamienMcKenna
- π©πͺGermany gbyte Berlin
Sitemap paths are not your regular paths. They are purposefully not normalized (you can't visit a localized version of the path) and there has never been a plan to support aliases. Since sitmemaps are supposed to be ingested by bots, their URLs don't matter to most.
I haven't had a look, but how are you adding the aliases BTW?
I don't plan on testing and implementing this, but feel free to try convincing me by creating a merge request.
As with close to all the issues you've ever submitted, I wouldn't classify this as a bug from the get-go. XD
- Assigned to DamienMcKenna
- πΊπΈUnited States DamienMcKenna NH, USA
The alias was added through the normal path alias interface: /admin/config/search/path/add
Non-normalized paths make SEO consultants cry ;-)
While I understand that "sitemap.xml" is a standard path for scanner tools to load, the files loaded within that file, i.e. the site variant paths, have no such requirement. Drupal will load the sitemap variant with the aliased paths, but the index ignores this and uses the system path. While you consider this to be a feature request because you purposefully built it this way, I was unaware this was a purposeful choice so deemed it a bug as the expected behavior in Drupal is that all rendered paths use the alias if one is present.
I'll work on a fix :p for this tomorrow.
- Status changed to Needs review
about 1 year ago 4:44pm 8 March 2024 - last update
about 1 year ago 32 pass - πΊπΈUnited States DamienMcKenna NH, USA
How about this? It adds an option under the advanced settings that allows the sitemap URLs to be passed through the site aliases system. It defaults to off to avoid surprises for existing sites. Also the settings field warns against using it when using multiple languages, which triggered the original bug that lead to this change in the first place.
- Issue was unassigned.
- Status changed to Needs work
about 1 year ago 7:21pm 12 March 2024 - π©πͺGermany gbyte Berlin
Having a setting that breaks one thing in order to allow something else is not an ideal situation. We turned off path processing in order to remove language prefixed paths. Instead of having two half-solutions, we should find a way to disable these language prefixes without breaking aliases. I'll be honest with you, it will have to be a quite clean solution to land. If you are still willing to look into it, thanks and good luck! Otherwise, this is quite niche so it's not at the top of my priority list.
- π·πΊRussia walkingdexter
We turned off path processing in order to remove language prefixed paths. Instead of having two half-solutions, we should find a way to disable these language prefixes without breaking aliases.
The original problem is already fixed in Drupal 10.3 π Language negotiation breaks updating Drupal 9 to 10 Needs work . So the change from π Unexpected language prefixes on sitemap index Fixed can be reverted, but the core version requirement should be increased to 10.3. I think we don't have to worry about it because 10.2 is no longer supported. Just tested all the changes and everything works fine, including path aliases.
-
walkingdexter β
authored d4366c17 on 4.x
Issue #3426492 by damienmckenna, gbyte, walkingdexter: Support path...
-
walkingdexter β
authored d4366c17 on 4.x
Automatically closed - issue fixed for 2 weeks with no activity.