【问题标题】:Hashbang, prereder.io and the robotsHashbang、prereder.io 和机器人
【发布时间】:2014-01-10 00:34:40
【问题描述】:

我对搜索机器人将如何抓取我的 ajax 网站感到有些困惑。

http://www.example.com 包含 3 个链接

  • #!/abc
  • #!/xyz
  • #!/123

我的页面顶部包含<meta name="fragment" content="!">,因此机器人应该使用以下网址访问这些链接,并且我正在使用 prerender.io 来提供页面

机器人在抓取这些页面时会有什么表现?当他们在这些页面上找到新链接时,网址会是什么样子?

  1. #!/abc1 => http://www.example.com?_escaped_fragment_=/abc#!/abc1
  2. #!/abc2 => http://www.example.com/#!/abc/abc2

【问题讨论】:

    标签: angularjs googlebot hashbang prerender


    【解决方案1】:

    这是 Google 的完整 AJAX 抓取规范:https://developers.google.com/webmasters/ajax-crawling/docs/specification

    机器人将看到#! 并将它们转换为_escaped_fragment_ URL,就像您提到的那样。 <meta name="fragment" content="!"> 标记仅对没有 #! 的页面是必需的,例如您的主页或任何 HTML5 推送状态 URL。如果 URL 有 #!,Google 会自动询问 _escaped_fragment_,而不检查 <meta name="fragment" content="!">

    如果 Google 抓取 http://example.com?_escaped_fragment_=/abc 并在该页面上找到 /#!/xyz 的链接,它将单独请求 http://example.com?_escaped_fragment_=/xyz

    因此,您应该始终将您的 URL 链接到 #! URL,而不是 _escaped_fragment_ URL。 Google 将自行改造它们。

    【讨论】:

      猜你喜欢
      • 2014-12-11
      • 1970-01-01
      • 2016-12-18
      • 2013-07-29
      • 2010-12-04
      • 2018-11-19
      • 2021-12-21
      • 2020-07-03
      • 2020-09-23
      相关资源
      最近更新 更多