From 3ccc9b38ff893f53a16dac59dd5bdf1eb959e285 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20Re=C3=A9?= Date: Thu, 2 Jan 2025 14:12:42 +0100 Subject: [PATCH] Stop generating sitemap.xml.gz (#6561) We generate sitemap-index.xml which is also put correctly into robots.txt. However we still provide the old sitemap.xml.gz. But, while this serves no purpose in addition to the index, it can cause problems if Google somehow parses it (for example it's submitted to the Google Search console). For this reason, we stop providing sitemap.xml.gz. --- packages/volto/news/6561.bugfix | 1 + packages/volto/src/express-middleware/sitemap.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 packages/volto/news/6561.bugfix diff --git a/packages/volto/news/6561.bugfix b/packages/volto/news/6561.bugfix new file mode 100644 index 0000000000..def9b0aaf9 --- /dev/null +++ b/packages/volto/news/6561.bugfix @@ -0,0 +1 @@ +Stop generating sitemap.xml.gz @reebalazs \ No newline at end of file diff --git a/packages/volto/src/express-middleware/sitemap.js b/packages/volto/src/express-middleware/sitemap.js index 59bf641c8f..cb477f07e1 100644 --- a/packages/volto/src/express-middleware/sitemap.js +++ b/packages/volto/src/express-middleware/sitemap.js @@ -50,7 +50,8 @@ export const sitemapIndex = function (req, res, next) { export default function sitemapMiddleware() { const middleware = express.Router(); - middleware.all('**/sitemap.xml.gz', sitemap); + // Do not deliver the old sitemap.xml.gz as it might cause issues if Google parses it + // in addition to the sitemap-index.xml. middleware.all('**/sitemap:batch.xml.gz', sitemap); middleware.all('**/sitemap-index.xml', sitemapIndex); middleware.id = 'sitemap.xml.gz';