最近在琢磨Nodejs,主要采用如下第三方库:
Express.js
Swig.js
Angular.js
React.js
gulp.js
对搜索进行了简单测试,部署了一个纯静态页面和Node.js的页面,在百度和谷歌中直接搜索域名,发现纯静态页面的能搜索到,但Node.js怎么都搜索不到。
想问下大家Nodejs的页面怎么SEO呢?
阿神2017-04-17 11:48:28
I have done some research on this problem, but there is no good solution
http://isay.me/2014/06/angular-prerender-seo-and-use-resolve-for-page-...
大家讲道理2017-04-17 11:48:28
If you use a front-end library such as Angular/React, you can use Prerender for SEO
I personally think that the reason why web pages cannot be indexed by search engines is not due to Node.js. Node.js can also write static web pages, which can also be crawled by search engine crawlers. The main reason is Angular/React, because these front-ends The library allows web content to be loaded dynamically. All search engines see are some js tags. Only by obtaining the content in advance can the web page be correctly included by search engines
天蓬老师2017-04-17 11:48:28
I feel like it’s better to change the title. It should be called How to SEO with angularjs
阿神2017-04-17 11:48:28
If you use back-end rendering, there will be no problem with SEO.
Doesn't express have a backend routing?
If it is made into a single-page application, the routing will inevitably be controlled by the front end, and the rendering method will also be front-end rendering. Since the page is made up of characters, there is no so-called SEO.
伊谢尔伦2017-04-17 11:48:28
Not easy to do
http://angularjs.cn/ I remember seeing a post on this site saying that it made two copies, one specifically for search engines
阿神2017-04-17 11:48:28
Google is totally fine. I have an English website, based on Angularjs, and Google can include it normally
Also, this problem seems to have nothing to do with Nodejs
迷茫2017-04-17 11:48:28
The introduction here is very detailed. If you don't understand something, you can chat with the author, he is very enthusiastic.
http://www.cnblogs.com/whitewolf/p/3464555.html
天蓬老师2017-04-17 11:48:28
It has nothing to do with node.js. It is a common problem of SPA (Single Page App). If you use React, you can consider using isomorphic method to render pages that require SEO with the server. However, it will have a certain impact on performance and development will be complicated. Click
天蓬老师2017-04-17 11:48:28
Look back at the question from more than a year ago and answer it yourself:
Solution: isomorphic, that is, back-end rendering~
Two cores of isomorphism:
1. environment agnostic
2. shim for the each environment
Recommend a very good book (please search CSDN resources):
Building Isomorphic JavaScript Apps