Home  >  Q&A  >  body text

angular.js - SPA如何对SEO优化

我们项目的网站全部由angularjs写的,前后端通过ajax交换数据。所以爬虫爬下来的页面都是空白的。而且页面中很多数据都是由事件出发才能展现的,比如点击加载评论,滚动翻页等。google可以运行页面中的js,但是百度不能,而我们SEO针对的却是百度。

那么针对此类网站,SEO应该如何做?
prerender.io虽然能把页面渲染出来,但是更多基于事件触发的数据却无法展现,所以对于我们这不是个好的方案。
单独为搜索引擎制作静态页面,检测请求UA,并将页面返回,这种方法算不算是黑帽SEO技术?
或者有没有更好的解决办法

伊谢尔伦伊谢尔伦2691 days ago722

reply all(2)I'll reply

  • 为情所困

    为情所困2017-05-15 16:51:19

    See Google’s related documentation: Making AJAX Applications Crawlable

    reply
    0
  • 怪我咯

    怪我咯2017-05-15 16:51:19

    Create a static page for search engines separately, detect the requested UA, and return the page. Is this method considered a black hat SEO technique?
    This is considered a black hat. It uses UA to judge and return to different pages. This allows users and search engines to see the difference. There are many people doing it. There should be some that survive.
    Baidu may not be as good as GG in capturing data such as ajax. I saw a case in the past and it seems to do this. It will show the user information to fix the screen, but there will be text below it to explain the description, so The search engine can crawl the content to be expressed on the page and think it can be used as a reference.

    reply
    0
  • Cancelreply