Skip to content

fix(sitemap): add .html extension to URLs when build.format is file#15584

Open
mixelburg wants to merge 1 commit intowithastro:mainfrom
mixelburg:fix/sitemap-file-format-extension
Open

fix(sitemap): add .html extension to URLs when build.format is file#15584
mixelburg wants to merge 1 commit intowithastro:mainfrom
mixelburg:fix/sitemap-file-format-extension

Conversation

@mixelburg
Copy link

Description

When build.format is set to 'file', Astro outputs pages with .html extensions (e.g., about.html). However, the sitemap integration was generating URLs without extensions (e.g., /about instead of /about.html), leading to incorrect sitemap entries.

Changes

  • Added a check in the sitemap URL generation to append .html when build.format === 'file'
  • Updated the corresponding test to expect .html extensions
  • Added changeset

Fixes #15526

When `build.format` is set to `'file'`, output files have .html
extensions (e.g., about.html) but the sitemap was generating URLs
without extensions (e.g., /about instead of /about.html), resulting
in 404s when crawlers follow those links.

Fixes withastro#15526
@changeset-bot
Copy link

changeset-bot bot commented Feb 19, 2026

🦋 Changeset detected

Latest commit: 1c0a50b

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the pkg: integration Related to any renderer integration (scope) label Feb 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg: integration Related to any renderer integration (scope)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sitemap URLs missing extensions when build.format = file

1 participant

Comments