Silverstripe Version: SS5.3
Question:
I have the Google Sitemaps module GitHub - wilr/silverstripe-googlesitemaps: Google Sitemaps module for the SilverStripe CMS installed and it was previously working fine.
Now, when visiting https://mysite.ddev.site/sitemap.xml it displays as a blank white page (likely due to the xml being incomplete).
In the browser web inspector I get:
<?xml-stylesheet type='text/xsl' href='http://mysite.ddev.site/sitemap.xml/styleSheetIndex'?>
I thought the problem might have something to do with a module I’d installed or config change. I’ve stepped through a completely new install, and it works fine with all the same modules installed as on my site. Same with the config.
In the test install I get the following in browser web inspector:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:sitemap="http://www.sitemaps.org/schemas/sitemap/0.9"><head><title>XML Sitemap</title><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><link rel="stylesheet" href="/_resources/vendor/wilr/silverstripe-googlesitemaps/css/style.css?m=1712549048"></head><body><div class="content"><h1 class="content__title"><a href="https://www.silverstripe.org" target="_blank" rel="noopener noreferrer">XML Sitemap</a></h1><p class="content__text">
This sitemap consists of 1 part(s).
</p><div class="table-wrapper"><table id="sitemapindex" class="table"><thead><tr><th class="table__cell table__cell--w-85">URL</th><th class="table__cell table__cell--w-15">Last Change</th></tr></thead><tbody><tr><td class="table__cell"><a href="https://ss5test.ddev.site/sitemap.xml/sitemap/SilverStripe-CMS-Model-SiteTree/1">https://ss5test.ddev.site/sitemap.xml/sitemap/SilverStripe-CMS-Model-SiteTree/1</a></td><td class="table__cell">2024-07-26 </td></tr></tbody></table></div><p class="content__text">
Generated by the Silverstripe CMS
<a href="https://github.com/wilr/silverstripe-googlesitemaps" target="_blank" rel="noopener noreferrer" title="SilverStripe Google Sitemaps module on Github">Google Sitemaps Module</a></p><p class="content__text">
More information about XML sitemaps on <a href="https://sitemaps.org" target="_blank" rel="noopener noreferrer">sitemaps.org</a></p></div></body></html>
<head><title>XML Sitemap</title><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><link rel="stylesheet" href="/_resources/vendor/wilr/silverstripe-googlesitemaps/css/style.css?m=1712549048"></head>
<title>XML Sitemap</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="/_resources/vendor/wilr/silverstripe-googlesitemaps/css/style.css?m=1712549048">
<head><title>XML Sitemap</title><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><link rel="stylesheet" href="/_resources/vendor/wilr/silverstripe-googlesitemaps/css/style.css?m=1712549048"></head>
<body><div class="content"><h1 class="content__title"><a href="https://www.silverstripe.org" target="_blank" rel="noopener noreferrer">XML Sitemap</a></h1><p class="content__text">
This sitemap consists of 1 part(s).
</p><div class="table-wrapper"><table id="sitemapindex" class="table"><thead><tr><th class="table__cell table__cell--w-85">URL</th><th class="table__cell table__cell--w-15">Last Change</th></tr></thead><tbody><tr><td class="table__cell"><a href="https://ss5test.ddev.site/sitemap.xml/sitemap/SilverStripe-CMS-Model-SiteTree/1">https://ss5test.ddev.site/sitemap.xml/sitemap/SilverStripe-CMS-Model-SiteTree/1</a></td><td class="table__cell">2024-07-26 </td></tr></tbody></table></div><p class="content__text">
Generated by the Silverstripe CMS
<a href="https://github.com/wilr/silverstripe-googlesitemaps" target="_blank" rel="noopener noreferrer" title="SilverStripe Google Sitemaps module on Github">Google Sitemaps Module</a></p><p class="content__text">
More information about XML sitemaps on <a href="https://sitemaps.org" target="_blank" rel="noopener noreferrer">sitemaps.org</a></p></div></body>
<div class="content"><h1 class="content__title"><a href="https://www.silverstripe.org" target="_blank" rel="noopener noreferrer">XML Sitemap</a></h1><p class="content__text">
This sitemap consists of 1 part(s).
</p><div class="table-wrapper"><table id="sitemapindex" class="table"><thead><tr><th class="table__cell table__cell--w-85">URL</th><th class="table__cell table__cell--w-15">Last Change</th></tr></thead><tbody><tr><td class="table__cell"><a href="https://ss5test.ddev.site/sitemap.xml/sitemap/SilverStripe-CMS-Model-SiteTree/1">https://ss5test.ddev.site/sitemap.xml/sitemap/SilverStripe-CMS-Model-SiteTree/1</a></td><td class="table__cell">2024-07-26 </td></tr></tbody></table></div><p class="content__text">
Generated by the Silverstripe CMS
<a href="https://github.com/wilr/silverstripe-googlesitemaps" target="_blank" rel="noopener noreferrer" title="SilverStripe Google Sitemaps module on Github">Google Sitemaps Module</a></p><p class="content__text">
More information about XML sitemaps on <a href="https://sitemaps.org" target="_blank" rel="noopener noreferrer">sitemaps.org</a></p></div>
<h1 class="content__title"><a href="https://www.silverstripe.org" target="_blank" rel="noopener noreferrer">XML Sitemap</a></h1>
<p class="content__text">
This sitemap consists of 1 part(s).
</p>
<div class="table-wrapper"><table id="sitemapindex" class="table"><thead><tr><th class="table__cell table__cell--w-85">URL</th><th class="table__cell table__cell--w-15">Last Change</th></tr></thead><tbody><tr><td class="table__cell"><a href="https://ss5test.ddev.site/sitemap.xml/sitemap/SilverStripe-CMS-Model-SiteTree/1">https://ss5test.ddev.site/sitemap.xml/sitemap/SilverStripe-CMS-Model-SiteTree/1</a></td><td class="table__cell">2024-07-26 </td></tr></tbody></table></div>
<p class="content__text">
Generated by the Silverstripe CMS
<a href="https://github.com/wilr/silverstripe-googlesitemaps" target="_blank" rel="noopener noreferrer" title="SilverStripe Google Sitemaps module on Github">Google Sitemaps Module</a></p>
<p class="content__text">
More information about XML sitemaps on <a href="https://sitemaps.org" target="_blank" rel="noopener noreferrer">sitemaps.org</a></p>
<div class="content"><h1 class="content__title"><a href="https://www.silverstripe.org" target="_blank" rel="noopener noreferrer">XML Sitemap</a></h1><p class="content__text">
This sitemap consists of 1 part(s).
</p><div class="table-wrapper"><table id="sitemapindex" class="table"><thead><tr><th class="table__cell table__cell--w-85">URL</th><th class="table__cell table__cell--w-15">Last Change</th></tr></thead><tbody><tr><td class="table__cell"><a href="https://ss5test.ddev.site/sitemap.xml/sitemap/SilverStripe-CMS-Model-SiteTree/1">https://ss5test.ddev.site/sitemap.xml/sitemap/SilverStripe-CMS-Model-SiteTree/1</a></td><td class="table__cell">2024-07-26 </td></tr></tbody></table></div><p class="content__text">
Generated by the Silverstripe CMS
<a href="https://github.com/wilr/silverstripe-googlesitemaps" target="_blank" rel="noopener noreferrer" title="SilverStripe Google Sitemaps module on Github">Google Sitemaps Module</a></p><p class="content__text">
More information about XML sitemaps on <a href="https://sitemaps.org" target="_blank" rel="noopener noreferrer">sitemaps.org</a></p></div>
<body><div class="content"><h1 class="content__title"><a href="https://www.silverstripe.org" target="_blank" rel="noopener noreferrer">XML Sitemap</a></h1><p class="content__text">
This sitemap consists of 1 part(s).
</p><div class="table-wrapper"><table id="sitemapindex" class="table"><thead><tr><th class="table__cell table__cell--w-85">URL</th><th class="table__cell table__cell--w-15">Last Change</th></tr></thead><tbody><tr><td class="table__cell"><a href="https://ss5test.ddev.site/sitemap.xml/sitemap/SilverStripe-CMS-Model-SiteTree/1">https://ss5test.ddev.site/sitemap.xml/sitemap/SilverStripe-CMS-Model-SiteTree/1</a></td><td class="table__cell">2024-07-26 </td></tr></tbody></table></div><p class="content__text">
Generated by the Silverstripe CMS
<a href="https://github.com/wilr/silverstripe-googlesitemaps" target="_blank" rel="noopener noreferrer" title="SilverStripe Google Sitemaps module on Github">Google Sitemaps Module</a></p><p class="content__text">
More information about XML sitemaps on <a href="https://sitemaps.org" target="_blank" rel="noopener noreferrer">sitemaps.org</a></p></div></body>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:sitemap="http://www.sitemaps.org/schemas/sitemap/0.9"><head><title>XML Sitemap</title><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><link rel="stylesheet" href="/_resources/vendor/wilr/silverstripe-googlesitemaps/css/style.css?m=1712549048"></head><body><div class="content"><h1 class="content__title"><a href="https://www.silverstripe.org" target="_blank" rel="noopener noreferrer">XML Sitemap</a></h1><p class="content__text">
This sitemap consists of 1 part(s).
</p><div class="table-wrapper"><table id="sitemapindex" class="table"><thead><tr><th class="table__cell table__cell--w-85">URL</th><th class="table__cell table__cell--w-15">Last Change</th></tr></thead><tbody><tr><td class="table__cell"><a href="https://ss5test.ddev.site/sitemap.xml/sitemap/SilverStripe-CMS-Model-SiteTree/1">https://ss5test.ddev.site/sitemap.xml/sitemap/SilverStripe-CMS-Model-SiteTree/1</a></td><td class="table__cell">2024-07-26 </td></tr></tbody></table></div><p class="content__text">
Generated by the Silverstripe CMS
<a href="https://github.com/wilr/silverstripe-googlesitemaps" target="_blank" rel="noopener noreferrer" title="SilverStripe Google Sitemaps module on Github">Google Sitemaps Module</a></p><p class="content__text">
More information about XML sitemaps on <a href="https://sitemaps.org" target="_blank" rel="noopener noreferrer">sitemaps.org</a></p></div></body></html>
Short of regenerating every single page in the SiteTree (there’s over 100), I’m at a loss how to debug this. There is no error logged anywhere and I have the following set in _config.php
ini_set('display_errors', 1);
error_reporting(E_ALL);
Any help with figuring this out would be much appreciated!