I’ve an angular.js app. I have followed google’s guide for ajax based applications. I’ve done this:
- meta tags
<base href="/">
<meta name="fragment" content="!">
- angular.js config
$locationProvider.html5Mode(true);
$locationProvider.hashPrefix('!');
- my html links looks like this(is it wrong?):
<a ng-href="/#!/login">Login</a>
- 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.
2
Answers
We struggled with the same issue for quite a long period and after decided to use service prerender.io that makes static cache of you app and provide this content for google and other search crawlers.
This is correct, as of this official announcement.
Also there was additional best-practice introduced:
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.