我读过一篇文章,教我如何让搜索引擎机器人抓取我的 ajax 页面,当我使用片段 url #! 时它工作得很好,但现在我正在尝试创建一个“主页”没有使用下面元标记的片段:
<meta name="fragment" content="!" />
我正在使用下面的代码片段来了解 googlebot 发生了什么。
<?php
if( isset( $_GET['_escaped_fragment_'] ) )
{
echo "Crawler is gonna read that page!";
}
?>
事实是机器人没有在 _escaped_fragment_ 语句中返回任何值。
这是页面的链接:http://www.linkerama.com/novo/
当我使用浏览器时,这个返回一个值:http://www.linkerama.com/novo/?_escaped_fragment_=
最佳答案
你如何测试这个?如果您使用的是“Fetch as Google”,请阅读下文。
引自 http://productforums.google.com/forum/#!category-topic/webmasters/crawling-indexing--ranking/bZgWCJTnl08%5B1-25%5D作者:John Mueller(谷歌员工)
Looking at your blog's homepage, one thing to keep in mind is that the Fetch as Googlebot feature does not parse the content that it fetches. So when you submit toddmoyer.net/blog/ , it fetches that URL. After fetching the URL, it doesn't parse it to check for the "fragment" meta tag, it just returns it to you. However, if you fetch toddmoyer.net/blog/#! , then it should rewrite the URL and fetch the URL toddmoyer.net/blog/?_escaped_fragment_= .
When we crawl and index your pages, we'll notice the meta-tag and act accordingly. It's just the Fetch as Googlebot feature that doesn't check for meta-tags, and instead just returns the raw content.
希望对您有所帮助。
关于php - Ajax 片段元标记 - Googlebot 未读取页面内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10228133/