thomasdavis/seoserver
소개
SEO Server is a command line tool that runs a server that allows GoogleBot, as well as other crawlers, to crawl Javascript heavy websites.
개발 도구측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalWelcome!
Seo Server is a command line tool that runs a server that allows GoogleBot(and any other crawlers) to crawl your heavily Javascript built websites. The tool works with very little changes to your server or client side code.
This entire site is driven by Javascript(view the source or see the code). Click the `What does Google see?` button at the bottom of each page to see Seo Server in action.
How it works
Seo Server runs PhantomJs(headless webkit browser) which renders the page fully and returns the fully executed code to GoogleBot.
Getting started
1) you must install PhantomJs(http://phantomjs.org/) and link into your bin so that Seo Server can call it.
2) Seo Server is an NPM module so install via
sudo npm install -g seoserver
3) Now we have access to the Seo Server command line tool
seoserver start
Which starts an Express server on port 3000 or
seoserver -p 4000 start
Start it as a background process and log the output
seoserver -p 4000 start > seoserver.log & Telling GoogleBot to fetch from Seo Server
To tell GoogleBot that we are using ajaxed content we simply add to our sites index.html file the Google specific meta tag. If you view the source of this page you can see we have included the tag below.
<meta name="fragment" content="!">
Now whenever GoogleBot visits any of our pages it will try to load ?_escaped_fragment_=pathname
So if we were using Apache with mod rewrite and mod proxy, we can include in our .htaccess
RewriteCond %{QUERY_STRING} ^_escaped_fragment_=(.*)$
RewriteRule (.*) http://address-of-seoserver:3000/%1? [P]
Now all request from GoogleBot will be returned fully rendered. How GoogleBot sees the page can be tested with Google WebMasters(they allow you to simulate Google crawls and see the result instantly).
For other crawlers
Using mod rewrite, we can send other crawlers to Seo Server also
RewriteCond %{HTTP_USER_AGENT} ^DuckDuckBot/1.0;
RewriteRule (.*) http://address-of-seoserver:3000/%1? [P]
FAQ
Nothing here yet, but check out the examples on the left to see different types of ajaxed content. Also ask questions and give feedback on GitHub issues.
관련 프로젝트 살펴보기
불러오는 중…