AngularJS和Google Ajax Crawler

时间:2013-03-28 03:44:21

标签: ajax seo angularjs

所以基本上我试图让angularJs Routes看起来像这样

 www.example.com/ajax.html#!product=1234

而不是像这样

www.example.com/ajax.html#/product/1234

有什么希望吗?

2 个答案:

答案 0 :(得分:6)

您只需配置$location service并致电:

$locationProvider.hashPrefix("!")

答案 1 :(得分:1)

如果您正在运行ruby应用并希望遵守google ajax抓取方案 - 那么有一个gem可以为任何机架应用实现抓取方案....

gem install google_ajax_crawler

如何使用它的说明位于http://thecodeabode.blogspot.com.au/2013/03/backbonejs-and-seo-google-ajax-crawling.html,源代码位于https://github.com/benkitzelman/google-ajax-crawler