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, 7 Feb, 2022 at 4: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 at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article