1

I am using Magento 2.2.2. Please see below the current settings of the sitemap. wrong sitemap base path

It works correctly when we create sitemap by hitting generate button in admin. But when it gets generated automatically using cron it shows /public_html/ in sitemap index for sub-sitemaps, please see below image, its sitemap.xml

wrong sitemap base path Thank you

1
  • I'm also getting the error, but couldn't resolve using the solution you provided. Commented Oct 30, 2019 at 12:10

1 Answer 1

0

Fixed it. Its not recommended but you can try it as temporary fix. Override below file. Magento_Root/vendor/magento/module-sitemap/model/sitemap.php comment line 705 // return realpath($this->_request->getServer('DOCUMENT_ROOT')); And add your own domain directly. return 'https://www.example.com';

Working for now.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.