ASP.NET Web.sitemap to Generate sitemap.xml [closed]

你离开我真会死。 提交于 2019-12-22 10:49:43

问题


Basically, I'm trying to find a way to setup a handler so that will run whenever someone goes to http://www.example.com/sitemap.xml web.sitemap xml. When the user or bot hits that url I want to pull my local Web.sitemap file in my solution and generate sitemap.xml syntax. This syntax must conform to https://www.sitemaps.org/protocol.html syntax.


回答1:


I always prefer doing my own code, rather than use a library, where possible and did this some time ago - can't find the code right now, though this tutorial will get you going. It basically reads the sitemap and then uses the information to create a new google sitemap.

you can also extend it to add in any pages you may have in a database. Skies the limit really :)

It's in both C# and VB

Here is the tutorial | dynamic create google sitemap aspnet



来源:https://stackoverflow.com/questions/13087696/asp-net-web-sitemap-to-generate-sitemap-xml

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!