M2.4.2, v1.1.6: Google XML Sitemap is generated at the root if config divide sitemap as None

Created by Esther Nguyen, Modified on Tue, 21 Apr at 12:15 AM by Support Agent

ISSUE:

If the Divide sitemap section is configured, the sitemap will be correctly generated in the /pub folder, but if the Divide sitemap is configured as None, the sitemap will be generated at the root


SOLUTION:

There is a bug in our Google XML Sitemap module. When generated Sitemap, the code:

$destination = rtrim($this->getData('xml_sitemap_path'), '/')

     . '/' . $this->getData('xml_sitemap_filename');

$this->processVariable->getDirectory()->renameFile($path, $destination);

will replace the Sitemap file with the file in the destination. However, in the destination section, the root path is not appended, so if the root path is different from the Magento default, it will still be replaced = '/' (default).


To temporarily resolve the issue, please edit the file: app/code/Bss/XmlSiteMap/Model/Sitemap.php as below:


 

Or download the file attached below to override the current file on your site.


Count on us! Here are some information about BSS Commerce if you might be interested:


BSS Commerce is a full-service ecommerce agency with 14+ years of experience, supporting 75,000+ customers worldwide. As an Adobe Commerce Solution Bronze Partner and Select Magento Extensions Builder, we deliver trusted end-to-end solutions.


Our core strength is Magento, with 150+ extensions designed to enhance store performance and drive growth. With deep expertise from years of working on Magento websites, we deliver scalable, high-impact solutions backed by strong client trust.


Discover our extensions: https://bsscommerce.com/magento-2-extensions.html. 


Our Magento B2B Extension by BSS Commerce is a flagship, widely used global solution, providing an all-in-one system for pricing, account management, and efficient B2B workflows. 


>>> If you want to improve your visibility, install Magento SEO Extension by BSS Commerce


If you need further assistance, please don't hesitate to contact us.

Attachments (1)

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article