AngularJS / AJAX应用程序和搜索引擎爬虫 [英] AngularJS / AJAX app and search engine crawlers

查看:372
本文介绍了AngularJS / AJAX应用程序和搜索引擎爬虫的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Web应用程序,它大量使用AngularJS / AJAX和我想它由谷歌和其他搜索引擎是抓取。我的理解是,我需要做一些特别的东西,使其工作,如下所述: https://开头developers.google.com/webmasters/ajax-crawling

I've got a web app which heavily uses AngularJS / AJAX and I'd like it to be crawlable by Google and other search engines. My understanding is that I need to do something special to make it work, as described here: https://developers.google.com/webmasters/ajax-crawling

不幸的是,看起来很讨厌,我宁愿不引进哈希标签。我想要做的是服务于一个静态页面,Googlebot的(基于用户代理),直接或通过发送一个302重定向。这样一来,Web应用程序可以是相同的,整个Googlebot的解决办法是很好的隔离,直到它不再是必要的。

Unfortunately, that looks quite nasty and I'd rather not introduce the hash tags. What I'd like to do is to serve a static page to Googlebot (based on the User-Agent), either directly or by sending it a 302 redirect. That way, the web app can be the same, and the whole Googlebot workaround is nicely isolated until it is no longer necessary.

我担心的是,谷歌可能会错误地认为我试图欺骗Googlebot的,而我的目标是帮助它。你们有什么想对这种做法,和你有什么建议?

My worry is that Google may mistakenly assume that I'm trying to trick Googlebot, while my goal is to help it. What do you guys think about this approach, and what would you recommend?

推荐答案

截至2014年5月Googlebot会现在执行的JavaScript。检查WebmasterTools,看看谷歌如何看待您的网站。

As of May 2014 GoogleBot now executes JavaScript. Check WebmasterTools to see how Google sees your site.

http://googlewebmastercentral.blogspot.no/2014/05/understanding-web-pages-better.html

编辑:请注意,这并不意味着其他爬虫(必应,Facebook等),将执行JavaScript。您可能还需要采取额外步骤,确保这些爬虫可以看到你的网站。

Note that this does not mean other crawlers (Bing, Facebook, etc.) will execute Javascript. You may still need to take additional steps to ensure that these crawlers can see your site.

这篇关于AngularJS / AJAX应用程序和搜索引擎爬虫的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆