0

I have magento multi store view installation with structure like this:

example.com/it
example.com/fr
example.com/de

I wan't to configure sitemap.xml for every store view. Sitemap.xml files are generated in

example.com/sitemaps/it
example.com/sitemaps/fr
example.com/sitemaps/de

maps, which I did created manually.

Now I wan't to have sitemap.xml files accessible (for google webmaster tools) like this:

example.com/it/sitemap.xml
example.com/fr/sitemap.xml
example.com/de/sitemap.xml

Any suggestions hot to achieve this? Or maybe some better approach for my problem?

Thanks.

1

You can accomplish this by using an http rewrite rule. Add the following line inside your .htaccess file

RewriteRule ^([^/]+)/(sitemap.xml) /sitemaps/$1/sitemap.xml [L,NC]

after

RewriteEngine on

To use a default store code if none specified in the url, add the following line after the previous one:

RewriteRule ^([^/]*)sitemap.xml /sitemaps/it/sitemap.xml [L,NC]

(Obviously you can use other default store code)

  • Thanks! It's working. One more thing. How can I rewrite example.com/sitemap.xml to example.com/it/sitemap.xml? – Iztok Jun 18 '14 at 12:29
  • I've edited the answer. You just need to add another rule after the first one – Alex Dinca Jun 18 '14 at 13:22

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.