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

  • I'm also getting the error, but couldn't resolve using the solution you provided. – VIPIN A ROY Oct 30 '19 at 12:10

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, privacy policy and cookie policy

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