Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SEO in a backbone application so that google can index home, after phantomjs

I have Backbone website. I've used phantomjs so that search engines can look up though the js links (#!/something), following the _escaped_fragment_spec. I've checked using google webtools, to see how google will look my site, and mostly everything seems correct.

However, the main page (ex: www.example.com; the one with no #! in the link), google does not send the _escaped_fragment_spec, so the page is not sent to phantomjs, and js are not applied, therefore google is looking to a nearly empty page.

Does anyone knows how to indicate this, or solve the problem?

Thanks

Edit: According to google (https://developers.google.com/webmasters/ajax-crawling/docs/getting-started) You should add to head, however I've added it, and webtools - see as google, does not seam to be procesing the main page as javascript. Any help? The site with problems is http://www.boletus-app.com/ Thanks

like image 787
Mateu Avatar asked Dec 07 '25 07:12

Mateu


2 Answers

The answer to this question was to use the fragment meta tag

<meta name="fragment" content="!">

This will force all pages including the home page to be requested with escaped fragments

like image 151
Thomas Davis Avatar answered Dec 08 '25 21:12

Thomas Davis


The query parameter is named "_escaped_fragment", not "_escaped_fragment_spec".

Google will not execute the JavaScript in your client app. Google's AJAX application support is meant to support situations where AJAX/hashbang URLs from your site are linked to from other sites. For example, if someone links to http://example.com/app#!my-route, when Google's crawler encounters that link, it will translate it to http://example.com/app?_escaped_fragment=my-route before requesting it from your server. Your server code must handle this query parameter and generate the appropriate HTML to represent that URL for Google to index.

like image 28
G-Wiz Avatar answered Dec 08 '25 20:12

G-Wiz



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!