Question

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.

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top