php - Ajax 片段元标记 - Googlebot 未读取页面内容

标签 php ajax search-engine fragment meta-tags

我读过一篇文章,教我如何让搜索引擎机器人抓取我的 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/

相关文章:

php - 如何使用 PHP 使字符串对于 href 属性安全?

javascript - 当数据库中存在新行时自动更新 div

javascript - 使 AngularJs 可被搜索引擎抓取

php - 在不同版本的 PHP 中运行 Composer 有区别吗?

PHP:将数字设置为关联数组中的键

php - Adodb Active Record 与 Zend db_table

Flash 电影上的 javascript 对话框

递归函数中的 JavaScript promise

php - 剥离 html 以删除所有 js/css/html 标签以提供实际文本(显示在浏览器上)以将其用于索引和搜索

java - 查询生成器 - 不能/不应该