Evidence
A read-only audit of https://web.dtcdev.click at current main checked the sitemap index and each child path on the development host.
/sitemap.xml returns 200 and lists the ten canonical production locations required by the existing sitemap contract.
- Nine development child paths return
200 XML: main, blog, podcast, books, people, events, wiki, docs, and faq.
/sitemaps/courses.xml returns 500 text/html with X-Robots-Tag: noindex, nofollow instead of a valid XML sitemap.
The original audit incorrectly treated the production-origin <loc> values in the index as development request hosts; those canonical production URLs are intentional and remain unchanged. This issue is corrected to the reproducible development-host defect.
Scope
Make /sitemaps/courses.xml return a valid XML <urlset> on development for the current deployed database state, including the empty/no-course state, while preserving canonical production <loc> values, no-slash route policy, and production behavior. Reuse the existing _section_records("courses") and sitemap contract where possible; diagnose and fix the actual failure rather than adding fabricated course rows or weakening error handling.
Own only the smallest sitemap generation/routing code and focused tests needed for the courses section. Preserve the other nine sections and the index contract.
Non-goals
- No content import or course data population.
- No change to robots/indexing policy, canonical origin, DNS/AWS/CDN state, or production sitemap submission.
- No migration/model behavior or unrelated route/SEO redesign.
Acceptance criteria
Evidence
A read-only audit of
https://web.dtcdev.clickat current main checked the sitemap index and each child path on the development host./sitemap.xmlreturns200and lists the ten canonical production locations required by the existing sitemap contract.200XML:main,blog,podcast,books,people,events,wiki,docs, andfaq./sitemaps/courses.xmlreturns500 text/htmlwithX-Robots-Tag: noindex, nofollowinstead of a valid XML sitemap.The original audit incorrectly treated the production-origin
<loc>values in the index as development request hosts; those canonical production URLs are intentional and remain unchanged. This issue is corrected to the reproducible development-host defect.Scope
Make
/sitemaps/courses.xmlreturn a valid XML<urlset>on development for the current deployed database state, including the empty/no-course state, while preserving canonical production<loc>values, no-slash route policy, and production behavior. Reuse the existing_section_records("courses")and sitemap contract where possible; diagnose and fix the actual failure rather than adding fabricated course rows or weakening error handling.Own only the smallest sitemap generation/routing code and focused tests needed for the courses section. Preserve the other nine sections and the index contract.
Non-goals
Acceptance criteria
/sitemaps/courses.xmlreturns200 application/xmlfor an empty database and for a database containing visible/hidden courses.X-Robots-Tag: noindex, nofollowremains present in development.uv/Make quality and applicable browser/SEO gates pass. This is an XML response-only fix; screenshots are not applicable.