最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - SEO in a backbone application so that google can index home, after phantomjs - Stack Overflow

programmeradmin0浏览0评论

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; 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 () 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 / Thanks

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.; 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./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./ Thanks

Share Improve this question edited Jun 5, 2012 at 15:55 Mateu asked May 30, 2012 at 9:39 MateuMateu 2,6986 gold badges38 silver badges56 bronze badges 1
  • did you add in anything to your .htaccess to redirect to an 'seo server' or sub-domain, or did you handle in the escaped_fragment query parameter in the application itself? – Leonidas Commented Apr 25, 2013 at 18:57
Add a ment  | 

2 Answers 2

Reset to default 7

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

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./app#!my-route, when Google's crawler encounters that link, it will translate it to http://example./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.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论