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 Mon, 07 Feb 2022 at 04:53 PM by Esther Nguyen

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.


If you need any further assistance, please feel free to contact us. We'd be happy to support you!

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 atleast one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article