有一个简单的方法,使应用程序的JavaScript友好的搜索引擎优化? [英] Is there an easy way to make Javascript apps SEO friendly?

查看:186
本文介绍了有一个简单的方法,使应用程序的JavaScript友好的搜索引擎优化?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在寻找使用新的工作流程用于Web开发。 Yemoan,咕噜,并与AngularJS鲍尔似乎对前端开发的一个很好的解决方案。唯一的缺点是,SEO是绝对可怕。这似乎是这些服务的业务决策推动通过一个巨大的组成部分但我找不到任何解决方案。

I've been looking at using a new workflow process for web development. Yemoan, Grunt, and Bower with AngularJS seems like a great solution for front-end development. The only downside is that the SEO is absolutely horrible. This seems like a HUGE component of the business decision driving adoption of these services yet I can't find any solutions.

什么是制作搜索引擎友好的JavaScript应用了坚实的解决方案?

What's a solid solution for making SEO-friendly javascript apps?

推荐答案

制作AJAX富集的站点,目前的标准做法/应用搜索引擎友好是使用快照。请参阅本这里的谷歌教程: https://developers.google.com /网站管理员/ AJAX抓取/文档/ HTML快照在这里: https://developers.google.com/webmasters/ajax-crawling/docs/specification

The current standard practice for making ajax heavy sites/apps SEO friendly is to use snapshots. See the google tutorial on this here: https://developers.google.com/webmasters/ajax-crawling/docs/html-snapshot and here: https://developers.google.com/webmasters/ajax-crawling/docs/specification

要总结一下,你这个标记&LT增加; META NAME =片段的内容= GT!; 你的DOM。抓取工具会看到这一点,从 www.example.com 重定向本身 www.example.com?_escaped_fragment _ = 其中,它会被期待页面的快照。

To summarize, you add this tag <meta name="fragment" content="!"> to your DOM. The crawler will see this and redirect itself from www.example.com to www.example.com?_escaped_fragment_= where it will be expecting the snapshot of the page.

您可以手动将HTML从你的网站上复制所有的Ajax完成后,并创建快照文件自己。然而,这可能是一个相当麻烦。相反,你可以使用 PhantomJS 来自动完成这个过程。就个人而言,我会使用的.htaccess escaped_fragment 请求发送到已缓存的标记创建一个PHP文件从内容管理器时的编辑被做了。这使得它重新标记为爬虫查看(但对人类没有任何功能)。

You could manually copy the html from your site after all ajax is finished, and create your snapshot files yourself. However, this could be quite a nuisance. Instead, you could use PhantomJS to automate this process for you. Personally, I am going to use .htaccess to send the escaped_fragment requests to a single php file which has cached markup created from the content manager when the edits were made. This allows it to recreate the markup for crawlers to view (but no functionality for humans).

这篇关于有一个简单的方法,使应用程序的JavaScript友好的搜索引擎优化?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆