3

The reason is the way getBaseUrl function implemented on Magento\Store\Model\Store. public function getBaseUrl($type = UrlInterface::URL_TYPE_LINK, $secure = null) { ... case UrlInterface::URL_TYPE_MEDIA: $url = $this->_getMediaScriptUrl($this->filesystem, $secure); if (!$url) { ...


2

Maybe this below extension help you solve this : https://redchamps.com/xml-sitemap-exclude-url-magento-2-extension.html


2

Answer given a base on Magento 2.3.1 Opensource There are 3 files, the Sitemap related data of Products, Categories, and CMS Pages is coming Magento\Sitemap\Model\ResourceModel\Catalog\Category:getCollection() Magento\Sitemap\Model\ResourceModel\Catalog\Product:getCollection() Magento\Sitemap\Model\ResourceModel\Cms\Page:getCollection() So, you want to ...


1

CMS pages should be included automatically. Check generation settings Stores / Settings / Configuration / Catalog / XML Sitemap In the ‘Generation Settings’ set ‘Enables’ to ‘Yes’: Set the ‘Start Time’ for future update and set ‘Frequency’ to ‘Daily’ if you want it to be renewed in this regime. If that's all set it could be a permission issue. ...


1

I've found out that my plugin is firing ok after printing in __constructor bu method afterCollectSitemapItems not any more. So using public method generateXml like so: public function __construct( \Magento\Sitemap\Helper\Data $helper ) { $this->helper = $helper; } public function beforeGenerateXml( \Magento\...


1

Try this below and add your die as well public function __construct( \Magento\Sitemap\Helper\Data $helper ) { $this->helper = $helper; } public function afterCollectSitemapItems( \Magento\Sitemap\Model\Sitemap $subject ) { die('Not firing here either'); $storeId = $subject->...


1

Your di.xml code will be look like: <?xml version="1.0" ?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\Sitemap\Model\ResourceModel\Catalog\Product" type="{Vendorname}\{Modulename}\Rewrite\Magento\Sitemap\Model\...


1

Media directory is always in "pub" and the actual result is correct but when you want to browse it, you don't need to put "pub" in the URL. Try the direct URL: https://magento-site/media/sitemap-1-1.xml bydefault, magento .htaccess or nginx.sample file works like there is no need to put "pub" in the url but all the files and folders reside in "pub" folder ...


Only top voted, non community-wiki answers of a minimum length are eligible