Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hello!
Homepage in sitemap.xml generated by this module always has a trailing slash. Is it possible to remove it (or make optional)?
Comments
Comment #2
er.garg.karanI am looking for the same in Drupal 8 as well as Drupal 9 version of this module.
Comment #3
3CWebDev CreditAttribution: 3CWebDev commentedPlacing something like this in a custom module will remove the trailing slash:
Comment #4
Dave ReidIt's worth asking, why does it matter? Until there's a good reason why I'm going to recategorize this as a feature request, not a bug.
Comment #5
3CWebDev CreditAttribution: 3CWebDev commentedThe SEO team for our client requested the change. They said there is a slight issue because the domain shouldn't have a trailing slash. I doubt it matters, honestly, but they made the request and I saw this thread where someone else had requested it.
I agree, thought, it's not a bug. Perhaps an option to remove it through config as a feature request? But, with the hook it's easy enough to do without any module change.
Comment #6
Dave ReidUnless there's a documented need as to why this feature would be necessary, I'm just not sure it's worth the time supporting this officially. Until we can solve that first part, I would be inclined to just mark this as resolved since we have a documented way to accomplish this with the hook, it could be even extended to trim any trailing slashes from paths: