相关疑难解决方法(0)

Google僵尸网站在使用HTML5模式路由的AngularJS网站上进行抓取

我们有一个使用HTML5路线的AngularJS网站.我刚做了一些测试"Fetch as Google"运行.结果有点令人困惑:

但是,我们已准备好让Google无法抓取我们的网站,因此我们已添加,因此Google僵尸程序会使用"?_escaped_fragment_ ="重新访问我们的网页.我们按照此说明操作,https://developers.google.com/webmasters/ajax-crawling/docs/getting-started("处理没有散列片段的页面"一节).在我们的Nginx配置中,我们有这样的东西:

if ($args ~ "_escaped_fragment_=") {
    serve the static HTML snapshots
}
Run Code Online (Sandbox Code Playgroud)

,如果我们传递_escaped_fragment_ =我们自己,它确实工作正常.但是,Google僵尸程序从未尝试使用此参数抓取我们的网站,因此它从不抓取快照.我们错过了什么吗?我们是否还应该在我们的Nginx配置中为Google bot添加代理检测功能?像这样的东西?

if ($http_user_agent ~* "googlebot|yahoo|bingbot|baiduspider|yandex|yeti|yodaobot|gigabot|ia_archiver|facebookexternalhit|twitterbot|developers\.google\.com") {            

server from snapshots

}
Run Code Online (Sandbox Code Playgroud)

如果我们能够更好地理解这一点会很棒,非常感谢你!

更新:
我刚看过这个,http ://scotch.io/tutorials/javascript/angularjs-seo-with-prerender-io? _ escaped_fragment_ = tag #caveats.因此,似乎在使用手动工具(Fetch as Google)时,我们应该自己通过#!或?_escaped_fragment_ =在正确的地方.实际上,如果我在我们的案例中传递了?_escaped_fragment_ =,我确实看到了我们创建的HTML快照.

真的吗?这是如何工作的吗?

更新2 在此主题的底部,Google员工会验证Google网站管理员"抓取为Google",您需要自己手动传递_escaped_fragment_ =参数,https: //productforums.google.com/forum/#!msg /站长/ fZjdyjq0n98/PZ-nlq_2RjcJ

干杯,
伊拉克利斯

seo html5 googlebot nginx angularjs

17
推荐指数
2
解决办法
1万
查看次数

标签 统计

angularjs ×1

googlebot ×1

html5 ×1

nginx ×1

seo ×1