More and more websites are starting to adopt "single page Structure" (Single-page application).
The entire site has only one page, using AJAX technology, according to user input, load different content.
The advantage of this approach is that the user experience good, save traffic, the drawback is that Ajax content can not be crawled by search engines. For example, you have a website.
http://example.com
The user sees the different content through the URL of the well number structure.
Http://example.com#1
Http://example.com#2
Http://example.com#3
However, search engines only crawl example.com, do not ignore the well number, so can not index content.
To solve this problem, Google proposed the "well number + exclamation" structure.
Http://example.com#!1
When Google discovers the URL above, it automatically crawls another Web site:
Http://example.com/?_escaped_fragment_=1
More Wonderful content: http://www.bianceng.cnhttp://www.bianceng.cn/webkf/ajax/
As long as you put Ajax content on this site, Google will be included. But the problem is, the "well number + exclamation point" is very ugly and cumbersome. Twitter used this structure to
Http://twitter.com/ruanyf
Change into
Http://twitter.com/#!/ruanyf
As a result, users complained repeatedly, only to be abolished in six months.
So, is there any way to keep a more intuitive URL while still allowing search engines to crawl Ajax content?
I always thought there was no way to do it until two days ago I saw the discourse founder of Robin Ward's solution and couldn't help astounding.
Discourse is a forum program that relies heavily on Ajax, but must allow Google to include content. Its solution is to abandon the well number structure, using the History API.
The so-called History API, refers to the situation that does not refresh the page, change the browser address bar display URL (accurately, is to change the current state of the page). Here's an example where you click on the top button to start playing the music. Then, click on the link below to see what happened.
The URL of the address bar has changed, but music playback is not interrupted!