【问题标题】:google is not crawling my angularjs website after adding sitemap.xml添加 sitemap.xml 后,谷歌没有抓取我的 angularjs 网站
【发布时间】:2015-01-20 19:51:33
【问题描述】:

在阅读了有关 angularjs 和 SEO 的多个资源(包括 google 文档)后,我了解到让 google 抓取我的网站的 2 个主要选项是:

  1. 将 hashbang (#!) 添加到我的 URL,在来自爬虫引擎的请求到达我的服务器后(在请求中,#! 被 escape_fragment 替换)我应该使用外部服务(如prerender.io) 或自己实现。

2.在我的 URL 中添加 hashbang (#!) - 这样 google 就可以知道它在这个 url 中有一个动态呈现的数据,并将 sitemp.xml 添加到网站。 as it is shown here

这就是我处理路线的方式:

mi.config(['$routeProvider','$locationProvider', function ($routeProvider, $locationProvider) {
$routeProvider.when('/home', { templateUrl: 'js/app/partials/Home/Home.html' });
$routeProvider.when('/items/:CatId', { templateUrl: 'js/app/partials/Items/Items.html' });
$routeProvider.when('/about', { templateUrl: 'js/app/partials/about.html' });
$routeProvider.when('/checkout', { templateUrl: 'js/app/partials/Checkout/Checkout.html' });
$routeProvider.when('/contact', { templateUrl: 'js/app/partials/contact.php' });
$routeProvider.otherwise({ redirectTo: '/home' });


$locationProvider.hashPrefix('!');

This is my sitemap.xml

my website

我在网站管理员工具中看到,谷歌识别出新的站点地图,但它仍然没有抓取它们。

有什么我想念的吗?

【问题讨论】:

  • 您如何确定 Google 没有将您的网站编入索引?
  • 查看搜索结果:site:chefnoded.co.il/shop 并查看网站管理员工具
  • 缓存可能需要一段时间
  • 一个多星期前爬过...

标签: ajax angularjs seo google-crawlers


【解决方案1】:

考虑使用 Google Web Master 工具 - Section Crawl 来查看 Google 在抓取您的网站时是否发现了一些错误。

您还可以尝试“Fetch as Google”功能,它可以深入了解 Google 如何查看您的 Angular 应用程序。

在您的特定情况下,即使您发送 200 作为 HTTP 响应,某些页面(来自站点地图的链接)也不会返回任何可抓取的内容:

http://www.chefnoded.co.il/shop/#!/items/6

http://www.chefnoded.co.il/shop/#!/items/5

http://www.chefnoded.co.il/shop/#!/items/4

【讨论】:

  • 嗨,谷歌 webamster 工具没有错误。您发布的站点地图中的那些链接是故意为空的。这是为了将来使用。现在,即使是现有链接也不会在搜索结果中显示。即使我这样搜索:“site:chefnoded.co.il/shop”
  • 您检查过您的 Robots.txt 文件吗?
  • 我没有 robots.txt。我应该吗?
  • 据我了解,robots.txt,在我的例子中,对于告诉谷歌哪里不要抓取很有好处。如果我没有 robots.txt,它假设只是抓取所有链接
猜你喜欢
  • 2017-02-13
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-03-09
  • 1970-01-01
  • 1970-01-01
  • 2014-01-08
  • 1970-01-01
相关资源
最近更新 更多