javascript - angular.js 如何告诉谷歌索引我的网站?

标签 javascript angularjs indexing seo google-index

我有一个 angular.js 应用程序。我已经遵循了基于 ajax 的应用程序的谷歌指南。我已经这样做了:

  1. 元标记

<base href="/"> <meta name="fragment" content="!">

  1. angular.js 配置

$locationProvider.html5Mode(true); $locationProvider.hashPrefix('!');

  1. 我的 html 链接看起来像这样(有错吗?):

<a ng-href="/#!/login">Login</a>

  1. 我将站点地图提交到谷歌搜索控制台(x 个月前)

我发现我不应该使用 escaped_fragment,对吗?难道我做错了什么?它仍然没有索引。 Google 仅索引主页。

当我运行 fetch as google 工具时,它会正确呈现所有页面。

最佳答案

I found that I should not use escaped_fragment, is it correct?

这是正确的,截至目前 official announcement .


还引入了额外的最佳实践:

For optimal rendering and indexing, our new guideline specifies that you should allow Googlebot access to the JavaScript, CSS, and image files that your pages use. This provides you optimal rendering and indexing for your site. Disallowing crawling of Javascript or CSS files in your site’s robots.txt directly harms how well our algorithms render and index your content and can result in suboptimal rankings.

取自Official Google Webmasters Blog


那么,您是否允许 Googlebot 访问所有必要的文件?

您的网址是什么样的?是否也可以作为静态 HTML 访问?在 Google 的公告中,他们仍然推荐渐进式增强 的概念,因此在您的情况下也提供静态文件可能会有所帮助。

关于javascript - angular.js 如何告诉谷歌索引我的网站?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35311646/

相关文章:

javascript - ionic : mouse event within OpenLayers wasn't handled

javascript - 在作用域内声明函数并稍后调用它

indexing - 什么索引可以加快 X-Hive/Documentum xDB 中的 XQuery?

javascript - jQuery toggleClass 显示不同菜单相关

javascript - 注册作为 Typescript 类实现的 AngularJs 指令

mongodb - 如何确保 MongoDB 中数组第一个元素的索引以加快查询速度?

mysql - 为什么 select count(*) 不使用数据库中的索引而使用另一个数据库中的索引?

javascript - SyntaxHighlighter.all() 在 DOM 级别不起作用?

javascript - 如何在struts2应用中集成谷歌地图

javascript - 更改数据表上的默认排序 jQuery Bootstrap 插件