Announcement

Collapse
No announcement yet.

Multi-Domain XML Sitemaps

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Multi-Domain XML Sitemaps

    How would one handle multi-domain xml sitemaps using the 1st option when setting up multi-domain: Sell a Subset of Your Catalog From a New Domain.

    How does it work to have 2 different sitemaps (primarysitemap.xml and secondarysitemap.xml) be in the root while still only showing up for the correct domain?

    Ex:
    primary-domain .com/ primary-sitemap.xml shows up for primary-domain .com only and not secondary-domain .com

    secondary-domain.com/ secondary-sitemap.xml shows up for secondary-domain .com only and not primary-domain .com
    Last edited by SidFeyDesigns; 09-14-24, 09:35 PM.
    Nick Harkins
    www.loveisarose.com

    #2
    Also, how are robots.txt files handled?
    Nick Harkins
    www.loveisarose.com

    Comment


      #3
      I think I figured it out for sitemaps.xml, robots.txt, and also favicon.ico files.

      First I added secondary domain versions of each file to the root directory and then added some rewrite conditions and rules in the .htaccess file right after ### End - Miva Merchant URI Management.

      Code:
      # rewrite robots_sd.txt for secondary-domain.com
      RewriteCond %{HTTP_HOST} ^(.*)?secondary-domain(\.com)
      RewriteRule ^robots\.txt$ robots_sd.txt [L,NS]
      
      # rewrite favicon_sd.ico for secondary-domain.com
      RewriteCond %{HTTP_HOST} ^(.*)?secondary-domain(\.com)
      RewriteRule ^favicon\.ico$ favicon_sd.ico [L,NS]
      
      
      # redirect robots_sd.txt for primary-domain.com
      RewriteCond %{HTTP_HOST} ^(.*)?primary-domain(\.com)
      RewriteRule ^robots_sd.txt https://www.primary-domain.com/robots.txt [R=301,L,NE,NC]
      
      # redirect favicon_sd.ico for primary-domain.com
      RewriteCond %{HTTP_HOST} ^(.*)?primary-domain(\.com)
      RewriteRule ^favicon_sd.ico https://www.primary-domain.com/favicon.ico [R=301,L,NE,NC]
      
      
      # redirect sitemap_sd.xml for primary-domain.com
      RewriteCond %{HTTP_HOST} ^(.*)?primary-domain(\.com)
      RewriteRule ^sitemap_sd.xml https://www.primary-domain.com/sitemap.xml [R=301,L,NE,NC]
      
      # redirect sitemap.xml for secondary-domain.com
      RewriteCond %{HTTP_HOST} ^(.*)?secondary-domain(\.com)
      RewriteRule ^sitemap.xml https://www.secondary-domain.com/sitemap_sd.xml [R=301,L,NE,NC]
      For the sitemaps/robot.txt files I of course made sure everything matched Google Search Console & Bing Webmaster Tools.


      The only question I have is:
      Is it necessary to have the redirects in red above for the robots_sd.txt and favicon_sd.ico?

      Thanks
      Last edited by SidFeyDesigns; 09-15-24, 09:20 AM.
      Nick Harkins
      www.loveisarose.com

      Comment

      Working...
      X