我AngularJS应用程序的谷歌索引 [英] Google indexing of my AngularJS application
问题描述
有来自谷歌博客中,他们索引的JavaScript应用程序。然而,我的AngularJS应用www.fore-cite.com似乎完全不被索引。有什么特别的,我在为了使索引和使内容可搜索呢?
There was a blog post from google that they are indexing javascript applications. However, my AngularJS Application www.fore-cite.com seems not to be indexed at all. Is there anything special that I have to do in order to enable indexing and make the content searchable?
推荐答案
该谷歌抓取工具不会在其抓取的网页执行JavaScript的。随着AngularJS,还有你必须要确保你的应用是越来越抓取和索引正确几步。
The Google crawler does execute javascript on the pages that it crawls. With AngularJS, there are a few steps you have to take to make sure that your application is getting crawled and indexed properly.
有关HTML5的模式正常工作,您必须配置你的服务器,以便为不存在的目录的请求被重写到的index.html。
For the html5 mode to work properly, you must configure your webserver so that requests to directories that don't exist get rewritten to index.html.
谷歌不正确遵循angularjs应用的链接呢,所以你必须为你的所有路线的地图。这听起来像一个痛苦的事,但是,在适当的构建过程这可能是一个非常自动化的过程。 (一饮而尽,哼了一声,等。)
Google does not properly follow links in angularjs apps yet, therefore you must create a sitemap for all of your routes. This sounds like a pain to do, however, with proper build processes this can be a very automated process. (gulp, grunt, etc.)
这当然只适用于谷歌的爬虫。其他搜索爬虫例如Bing可能不支持JavaScript的应用程序还没有,不过我也不会感到惊讶,如果这个改变在未来一年或两年(如果它有没有。)
This of course only applies to the google crawler. Other search crawlers such as Bing may not support javascript applications yet, though I wouldn't be surprised if this changes over the next year or two (if it hasn't already.)
分度角的应用程序一个普遍错过了问题之类的东西分页和内容点击按钮后显示出来。如果这些操作不更改URL,谷歌不会抓取。例如,假设你有一个网页一个使用表分页,它有3页。谷歌将只抓取第一页,除非每一页都有一个不同的URL路径,例如 /表/页/ 1
/表/页/ 2
/表/页/ 3
One commonly missed problem with indexing angular apps is things like pagination and content that shows up after clicking a button. If these actions do not change the url, google will not crawl it. For example, say you have a page with a table using pagination and it has 3 pages. Google will only crawl the first page unless each page has a different url route such as /table/page/1
/table/page/2
/table/page/3
这篇关于我AngularJS应用程序的谷歌索引的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!