Skip to content

Commit 0f2609c

Browse files
peterdobsonMarkPieszak
authored andcommitted
fix(sitemap): update homecontroller sitemap tags
Renamed the "sitemapindex" & "sitemap" SitemapXml tags to "urlset" & "url" to allow Google Search Console to process sitemap.xml without errors closes TrilonIO#562
1 parent 0ad0f60 commit 0f2609c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Server/Controllers/HomeController.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,16 @@ public async Task<IActionResult> SitemapXml()
3838
{
3939
String xml = "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
4040

41-
xml += "<sitemapindex xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">";
42-
xml += "<sitemap>";
41+
xml += "<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">";
42+
xml += "<url>";
4343
xml += "<loc>http://localhost:4251/home</loc>";
4444
xml += "<lastmod>" + DateTime.Now.ToString("yyyy-MM-dd") + "</lastmod>";
45-
xml += "</sitemap>";
46-
xml += "<sitemap>";
45+
xml += "</url>";
46+
xml += "<url>";
4747
xml += "<loc>http://localhost:4251/counter</loc>";
4848
xml += "<lastmod>" + DateTime.Now.ToString("yyyy-MM-dd") + "</lastmod>";
49-
xml += "</sitemap>";
50-
xml += "</sitemapindex>";
49+
xml += "</url>";
50+
xml += "</urlset>";
5151

5252
return Content(xml, "text/xml");
5353

0 commit comments

Comments
 (0)