搜索引擎的站点地图
我必须进行 api 调用并获得响应。此响应包含超过 4000 个网址。 我必须在站点地图中列出所有这些网址,以便搜索引擎轻松抓取。我必须编写一个处理程序来完成这项任务。有人可以给我推荐一个这样做的例子吗?
I have to make an api call and get the response. This response contains more than 4000 urls.
I have to list all these urls in the sitemap for the search engines to crawl easily. I have to write a handler for doing this task. Can someone suggest me an example for doing this.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我假设您正在谈论 XML 格式的站点地图,但您没有指定什么除此之外,来源还在于您要进行 API 调用。然而,谷歌搜索“asp.net google sitemap”的第三个左右的结果应该会给你一个完美的起点:
http://www.mikesdotnetting.com/Article/94/Create-a-Google-Site-Map-with-ASP.NET
我建议创建一个 ASHX 处理程序(Visual Studio 中的文件 -> 新建 -> 通用处理程序),而不是像示例中那样创建页面。
将处理程序上传到网站,并使用网站管理员工具将站点地图添加到 Google 等。
I'll assume you are talking about a sitemap in XML format, but you didn't specify what the source is besides that you are to do an API call. However, the 3rd or so result from a Google search on "asp.net google sitemap" should give you a perfect starting point:
http://www.mikesdotnetting.com/Article/94/Create-a-Google-Site-Map-with-ASP.NET
I would suggest creating an ASHX handler (File -> New -> Generic Handler in Visual Studio) instead of a page like they do in the example.
Upload the handler to the website and add the sitemap to e.g. Google by using their Webmaster Tools.
在 Google 上快速搜索后得到了以下链接:
使用 ASP.NET 的 XML 站点地图
应该可以帮助您了解处理程序和编写 XML 的大部分内容。
A quick search on Google resulted in this link:
XML sitemap with ASP.NET
Which should get you most of the way with the handler and composing the XML.