React prerender.io fetch as google 不工作

React prerender.io fetch as google is not working

我正在为 ExpressJS 应用程序使用预渲染。我在 index.html 页面中保留了 <meta name="fragment" content="!">。当我使用 mywebsite.com/?_escape_fragment_= 时它工作正常,但是当我将 fetch as google 用于 mywebsite.com/ 时,我看不到任何数据。但是对于带有 ?_escape_fragment_= 的丑陋格式,它就像魅力一样工作。

Googlebot 是否会在 mywebsite.com 被编入索引时将其抓取为 mywebsite.com/?_escape_fragment_=,或者我需要为此做些什么?

Fetch as Google 有一个已知问题,它不会自动检查片段元标记。如果您在 Fetch as Google 中的 URL 末尾输入 ?_escaped_fragment_=,它应该能正确看到预渲染页面。

真正的 Googlebot 没有那个错误,他们会看到片段元标记并成功地自行抓取 ?_escaped_fragment_= URL。