seomultiple-domainsxml-sitemap

sitemap for multiple domains of same site


Here is the situation, i have a website that can be accessed from multiple domains, lets say www.domain1.com, www.domain2.net, www.domain3.com. the domains access the exact same code base, but depending on the domain, different CSS, graphics, etc are loaded.

everything works fine, but now my question is how do i deal with the sitemap.xml? i wrote the sitemap.xml for the default domain (www.domain1.com), but what about when the site is accessed from the other domains? the content of the sitemap.xml will contain the wrong domain.

i read that i can add multiple sitemap files to robots.txt, so does that mean that i can for example create sitemap-domain2.net.xml and sitemap-domain3.com.xml (containing the links with the matching domains) and simply add them to robots.txt?

somehow i have doubts that this would work thus i turn to you experts to shed some light on the subject :)

thanks


Solution

  • You should use server-side code to send the correct sitemap based on the domain name for requests to /sitemap.xml