简体   繁体   中英

Is angular.js with ui-router SEO friendly?

例如,如果内容动态加载并且像“mysite.com/#/some/page”这样的散列网址是SEO友好的,还是不会被Google和Bing编入索引?

Since search engines do not run javascript, you need to make static html versions for your pages so they can be indexed by them, also you should have a sitemap. There is a library that helps acomplish this using phantomjs: https://github.com/steeve/angular-seo This is further explained here: http://www.yearofmoo.com/2012/11/angularjs-and-seo.html

There are some paid services that take care of this for you.

Also Google has some more information on the matter: https://developers.google.com/webmasters/ajax-crawling/

Even if you have statically generated versions of your pages, Google doesn't follow the ui-sref directives that ui-router provides. Your best option is to use ng-href in combination with the escaped fragment ajax crawling specification. The project I'm currently working on is based on MeanJS which has a SEO module that implements the escaped fragment and is definitely working with Google.

MeanJS does include ui-router, but I only use it from the controllers, not in the views.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM