How to get a search engine to crawl Ajax content

Source: Internet
Author: User

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!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.