简体   繁体   中英

angular.js how to tell google to index my site?

I've an angular.js app. I have followed google's guide for ajax based applications. I've done this:

  1. meta tags

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

  1. angular.js config

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

  1. my html links looks like this(is it wrong?):

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

  1. I submitted sitemap into google search console (x months ago)

I found that I should not use escaped_fragment, is it correct? Am I doing something wrong? It's still not indexing. Google indexed just homepage.

When I run fetch as google tool it renders all pages correctly.

我们在相当长的一段时间内遇到了同样的问题,并且在决定使用服务prerender.io之后,使用app静态缓存并为谷歌和其他搜索抓取工具提供此内容。

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

This is correct, as of this official announcement .


Also there was additional best-practice introduced:

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.

Taken from the Official Google Webmasters Blog


So, are you allowing Googlebot access to all necessary files?

And how do your URLs look like? Are there also accessible as static HTML? As of the announcements of Google they still recommend the concept of Progressive enhancement , so it might be beneficial in your case to also serve static files.

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