First, create a new folder called sitemaps in the root of your website, then create subfolders for each domain.
/sitemaps/domain_1/
/sitemaps/domain_2/
Then login to the Magento admin and navigate to –
catatlog -> google sitemap
Create or edit the sitemap listings for each store and set the “path to sitemap” field to be the path you created for the store.
/sitemaps/domain_1/
/sitemaps/domain_2/
Update your robots.txt
file. To make sure that the search engine spiders are properly directed to the new sitemaps. You may need to update or create the robots.txt
file. Edit the robots.txt
file and add the following lines at the top —
# Website Sitemap
Sitemap: http://www.domain_1.com/sitemaps/domain_1/sitemap.xml
Sitemap: http://www.domain_2.com/sitemaps/domain_2/sitemap.xml
Finally, if your site uses the Apache web server engine, you should update the .htaccess
file in the root of your website to direct any other sitemap requests to the proper place.
Locate the following line below the line that reads —
RewriteEngine on
And add the following redirect statements below it —
# Sitemap: http://www.domain_1.com/sitemaps/domain_1/sitemap.xml
RewriteCond %{HTTP_HOST} ^.*domain_1\.com$
RewriteRule ^sitemap.xml$ sitemaps/domain_1/sitemap.xml [NC,L,R=301]
# Sitemap: http://www.domain_2.com/sitemaps/domain_2/sitemap.xml
RewriteCond %{HTTP_HOST} ^.*domain_2\.com$
RewriteRule ^sitemap.xml$ sitemaps/domain_2/sitemap.xml [NC,L,R=301]
Best Answer
Magento 2: By default not providing HTML Sitemap.
Can use Free Extension:
https://www.mageplaza.com/magento-2-seo-extension/
You have following options
CMS Pages: Can refer Magento 1 Article https://stackoverflow.com/questions/5020257/creating-a-magento-sitemap-page Then Convert it to Magento 2 will gonna Some What Helpfull for CMS Pages
For Categories & Sub Categories: Getting all available category, subcategory list in magento 2
For Categories Product's: Magento 2: get product collection using category id