-1

I have generated a XML sitemap for multi-site using a free online tool - https://www.xml-sitemaps.com. I have downloaded XML file for each site and placed sitemap.xml at the root (\src\sitemap.xml) for main site and for sub-sites placed at \src\sites\sub-site-name\sitemap.xml.

When I access the main site at www.main-site.com/sitemap.xml, I get the correct sitemap.xml but for sub-sites (www.sub-site.com/sitemap.xml), I am getting the sitemap of the main site every time. How can I access the sitemap.xml file for sub-sites at www.sub-site.com/sitemap.xml. I can access the sitemap.xml for sub-sites if I go to the path: www.sub-site.com/sites/sub-site.com/sitemap.xml.

  • Why not use XMLSitemap module or Simple XML Sitemap? A static file will not stay up to date at all. – Kevin Sep 12 '17 at 14:44
  • Or just submit the correct path for each to the search engines. You don't need it to be implied – Clive Sep 12 '17 at 15:42
  • My client requested to use the free online tool as they required the detailed listing in sitemap including all the links and file uploads. I already gave the detailed listing using Simple XML sitemap but that doesn't list down the file uploads in it. What should I do now. – Pranay Agarwal Sep 13 '17 at 5:39
  • Create symlinks stackoverflow.com/questions/1951742/… – Mohammad Anwar Sep 13 '17 at 13:37
0

I got proper sitemaps for each sub-site by using the code below:

Syntax: RewriteRule /?sitemap.xml %{DOCUMENT_ROOT}/sitemaps/%{HTTP_HOST}.xml [L] My way: RewriteRule ^sitemap.xml$ sitemap/%{HTTP_HOST}.xml [L]

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.