Closed benfeather closed 4 months ago
According to the spec, the sitemap files need to be served from the same domain as the URLs they point to:
https://www.sitemaps.org/protocol.html
Note that this means that all URLs listed in the Sitemap must use the same protocol (http, in this example) and reside on the same host as the Sitemap. For instance, if the Sitemap is located at http://www.example.com/sitemap.xml, it can't include URLs from http://subdomain.example.com.
Well, I learned something today! Thank you very much.
Question
I'm using Craft in headless mode and have the CMS and the frontend setup on different domains, like so:
The CMS is located at: cms.example.com The website is located at: www.example.com
When I use SEOmatic to generate sitemaps, it generates this output:
Index:
blog:
In the sitemap index file, the location of the XML files should be
cms.example.com
notwww.example.com
.I see there is a
Site URL Override
option but if I change that to the CMS's domain, the output becomes:Index:
Blog:
The index paths are now correct (the sitemap paths are using
cms.example.com
), however this also changes the page urls.Is there a way to set this up so all xml files use the cms url:
cms.example.com
And all of the page paths use the site url:www.example.com
Any help would be appreciated.