Good day. In general, I will describe the situation, so that it is more or less clear what's what. I have a project on angularjs , I need to be indexed in Google .

Google itself says that if you insert the meta tag <meta name="fragment" content="!"> header website header , the search engine understands that the site has ajax content and it has links like http://sitename/#!/blog/news reads like http://sitename?_escaped_fragment_=blog/news .

I did the following:

  1. in angularjs :

    Application.config(['$locationProvider',function($locationProvider){ $locationProvider.hashPrefix('!'); $locationProvider.html5Mode(true); }]);

  2. I wrote a mini engine that delivers content to Google via the link: http://sitename/api/html?page=blog/news .

  3. In .htaccess redirect all requests where there is a get parameter _escaped_fragment_ to api statics:

    RewriteCond %{REQUEST_URI} ^/$ RewriteCond %{QUERY_STRING} ^_escaped_fragment_=/?(.*)$ RewriteRule ^(.*)$ /api/html?page=%1 [NC,R=301,L]

  4. Link test http://sitename?_escaped_fragment_=blog/news - everything is fine, redirects to http://sitename/api/html?page=blog/news and shows the desired content.

And as if everything is good and everything should work correctly, but I check the links of the site in google.com/webmasters/tools - and there the html angularjs project (the one in which I inserted the meta tag <meta name="fragment" content="!"> ), and I understand that Google doesn’t even pay attention to <meta name="fragment" content="!"> .

Question: what am I doing wrong, how can I fix this? Can someone come across this, can someone give advice?

  • I would open the logs on the server and see if the ligoglovy bot goes where it needs to be. - KoVadim
  • 66.249.64.180 - - [03 / Oct / 2016: 11: 53: 15 +0300] "GET /robots.txt HTTP / 1.1" 200 1916 "-" "Mozilla / 5.0 (compatible; Googlebot / 2.1; + google.com /bot.html ) "66.249.64.180 - - [03 / Oct / 2016: 11: 53: 15 +0300]" GET / page / about us HTTP / 1.1 "200 1916" - "" Mozilla / 5.0 (compatible; Googlebot / 2.1; + google.com/bot.html ) " - Ivan Turcan
  • Google does not insert the get parameter, I understand that it doesn’t pay attention to the meta tag (fragment) - Іvan Turcan
  • I will reformulate. See if there are any references to links from 4 points in the log. - KoVadim
  • there is no such thing in the logs - Іvan Turcan

1 answer 1

A year ago, it was all canceled https://webmasters.googleblog.com/2015/10/deprecating-our-ajax-crawling-scheme.html Look for other ways or write your bike (for example, you can generate pages for php or nodejs for bots , and in .htaccess redirect all bots to the url these special pages)