Sitemap.xml when using a base path

This article is for people using a base path for hosting your Notaku website following 🖇️Hosting under a /docs or /blog path or 📘Hosting under a /blog path

How to expose a combined sitemap.xml file

You will need a root sitemap.xml file that combine your main sitemap and your Notaku website sitemap (hosted on /docs or /blog)

Example sitemap.xml file

Here is an example sitemap.xml file that merges a sitemap hosted on the /docs path with the original sitemap (hosted on /original-sitemap.xml)
<?xml version="1.0" encoding="UTF-8"?> <sitemapindex xmlns=""> <sitemap> <loc> </loc> </sitemap> <sitemap> <loc> </loc> </sitemap> </sitemapindex>
Notice the ? query parameter, you need to pass a host parameter with your domain name to use the correct urls in the child sitemap. Otherwise Notaku does not know what domain it should use for your pages urls.
If you already had a sitemap.xml file you will need to rename it and add an entry in <sitemapindex> (in the example above it has been renamed to original-sitemap.xml)

Submitting the sitemap to google

You will then need to submit your sitemap url to Google in your Search Console dashboard so that it can fetch your new urls.