Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ajax/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ajax内容索引,谷歌_Ajax_Seo - Fatal编程技术网

Ajax内容索引,谷歌

Ajax内容索引,谷歌,ajax,seo,Ajax,Seo,我按照Google网站的指示,通过添加以下元标记,在我的AngularJS网站上启用Ajax爬行: <meta name="fragment" content="!"> 问题是,通过使用网站www.somesite.com和服务器上的日志查看实际的索引内容,我发现GoogleBot试图索引页面,如: /user/1/#!/popular /user/1/#!/recent 考虑到这些URL是相对的,没有#,为什么会发生这样的事情呢!如果这些URL在所有页面上都可用,它会简单地添加

我按照Google网站的指示,通过添加以下元标记,在我的AngularJS网站上启用Ajax爬行:

<meta name="fragment" content="!">
问题是,通过使用网站www.somesite.com和服务器上的日志查看实际的索引内容,我发现GoogleBot试图索引页面,如:

/user/1/#!/popular
/user/1/#!/recent

考虑到这些URL是相对的,没有#,为什么会发生这样的事情呢!如果这些URL在所有页面上都可用,它会简单地添加它们

因此,如果我转到:
,然后又有
页面,那么谷歌加载:
/user/1#是合乎逻辑的/流行的

你可能想知道我用Github上的一个脚本解决了这个难题:


只需使用以下内容构建AJAX页面:
\uu init()

出于好奇,此搜索不应该返回一些结果吗?不,因为我有一个robots.txt。为什么,现在想法:-P我会改变的
<a href="#!/popular">Popular</a>
<a href="#!/recent">Recent</a>
_escaped_fragment_=%2fpopular
_escaped_fragment_=%2frecent
/user/1/#!/popular
/user/1/#!/recent