我已经完成了我的 Asp.Net 4.0 网站的工作。现在我要在接下来的几天内发布它,我正在寻找可以帮助我更好地在流行搜索引擎上对我的网站进行排名的资源。我的网站同时显示静态和动态内容。对于动态内容,我将每周生成动态站点地图。我的问题是我在谷歌网站管理员网站上看到谷歌只接受带有 .txt 扩展名的站点地图。(https://support.google.com/webmasters/answer/183668?hl=en)。原始指令引用为:
* For best results, use the following guidelines for creating text file sitemaps:
You must fully specify all URLs in your sitemap as Google attempts to crawl them exactly as you list them.
Your text file must use UTF-8 encoding.
Your text file should contain nothing but the list of URLs.
You can name the text file anything you wish, provided it has a .txt extension (for instance, sitemap.txt).
正如我所提到的,我将使用 c# 代码为我的站点动态生成 xml 站点地图,但我不确定我是否能够将 xml(通过使用 C#)写入 .txt 文件。我对使用 C# 编写 xml 知之甚少(例如使用 XmlWriter 类)。我发现这个网站使用的是 .xml 扩展名(http://www.mikesdotnetting.com/sitemap)的站点地图文件。谁能告诉我我需要做什么才能完成我项目的最后一步。我有兴趣知道的另一件事是,当链接被修改时,我是否应该每次将我的站点地图提交给谷歌?谷歌表示将您的站点地图提交给谷歌,其中包含不超过 50000 个网址或小于 50mb。