Magento – Sitemap for multistore shop

multistoresitemaps

As I know, google accept only one sitemap.
So we have a multi store like:

https://www.outdoorequipped.com/ <- entry page
https://www.outdoorequipped.com/active/
https://www.outdoorequipped.com/outdoor/
https://www.outdoorequipped.com/fashion/
https://www.outdoorequipped.com/work/

How do I set up or create a correct sitemap?

Best Answer

You need to create rewrites in .htaccess:
How to add sitemap.xml for multistore magento

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]
Related Topic