- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
此代码是否会正确指示 Google 为我的站点地图编制索引(或使其知道它存在)?
<link rel="sitemap" href="./sitemap.txt" type="text/plain" title="Sitemap" />
Google 在其
instructions 中声明允许简单地列出 URL 的纯文本文件作为站点地图格式,但我找不到关于如何在 HTML 中链接到此类文件的任何经过验证的解决方案
<head>
.
type
属性。这是链接到纯文本站点地图文件的可接受方式吗?
https://www.google.com/ping?sitemap=FULL_URL_OF_SITEMAP
(
Source )
最佳答案
回答您的问题:HTML5 定义了您可以在 rel
中使用的值。和 sitemap
不被验证器识别。所以简短的回答是:这行不通。另见此处:WIKI , 哪些语句是允许的。
基本上,让其他搜索引擎知道您有站点地图的最佳方法是将站点地图添加到您的 robots.txt 文件中。
因此,在您的网络服务器根目录中创建一个 robots.txt 文件,如下所示:example.com/robots.txt
然后将以下内容添加到文件中:
Sitemap: http://www.example.com/sitemap.txt
User-agent: *
Disallow:
该文件的内容告诉搜索引擎要抓取哪些页面(以及不抓取哪些页面)以及哪些搜索引擎有权抓取您的网站。拥有此文件很重要,因为当搜索引擎机器人进入您的网站时,它会先查找您的 robots.txt,然后再执行任何其他操作。
User-agent: Defines, which search engines are allowed to use the robots.txt file. However "bad" engines will still use the file, even if you say no. The * defines, that all engines are allowed to crawl the file.
Disallow: With this statement you can define, which directorys of your website should not be crawled by the search engines e.g. /photos/
关于html - 链接到 HTML 纯文本站点地图文件的正确方法是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68396772/
leaflet:一个开源并且对移动端友好的交互式地图 JavaScript 库 中文文档: https://leafletjs.cn/reference.html 官网(英文): ht
我是一名优秀的程序员,十分优秀!