Skip to content

Commit

Permalink
Stop generating sitemap.xml.gz (#6561)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
reebalazs committed Jan 2, 2025
1 parent 374dfbc commit 3ccc9b3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/volto/news/6561.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Stop generating sitemap.xml.gz @reebalazs
3 changes: 2 additions & 1 deletion packages/volto/src/express-middleware/sitemap.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit 3ccc9b3

Please sign in to comment.