给 dasBlog 添加支持 SiteMap 的功能
今天享受了一下 Google 的 WebMasters 服务,再加上 Google Analytics,真有 WebMater 的感觉。
在这个服务里面,为了网络爬虫能够更好地抓取页面,Google 需要你提供 SiteMap,一个 XML 格式文件。试了 Google 推荐的几个程序和服务,感觉都不是很好,鉴于 dasBlog 是开源的,简单研究了一下,为其添加了生成 SiteMap 的功能。
首先,下载 net.tangrui.DasBlog.Web.Services.dll 文件,将其放到 dasBlog 的 bin 目录下。
然后,修改 web.config 文件,在 <httpHandlers> 标签下,添加这样的节点:
<add verb="*" path="sitemap.ashx" type="net.tangrui.DasBlog.Web.Services.SiteMapHandler, net.tangrui.DasBlog.Web.Services" />
最后,访问 http://yourwebsite/sitemap.ashx 就可以了。
如果需要,可以到这里下载源代码。
This entry was posted on Saturday, August 26th, 2006 at 11:16 pm and is filed under ASP.NET, dasBlog, 计算机科学与技术. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.






































December 12th, 2006 at 12:51 pm
您好!
在Google上搜到您的这篇文章,我一直都不知道怎么给我的博客(http://binqiangliu.bloggerspaces.com/)添加sitemap,今天,找到您这篇文章,所以向您求助了!
如果可以,请指点一下哦,binqiangliu@gmail.com
谢谢先!
祝好!
静侯佳音!