Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do sites like twitter, gawker use #! instead of simple URL? [duplicate]

Possible Duplicate:
What's the shebang (#!) in Facebook and new Twitter URLs for?

Twitter's profiles now have URL in the form of:

http://twitter.com/#!/username

instead of the simpler structure:

http://twitter.com/username

What does #! do? What is the advantage of using #!? I read that it's related to google's web crawler, but I don't understand how exactly does that work.

like image 350
Continuation Avatar asked Jan 21 '23 13:01

Continuation


1 Answers

There are two parts to this:

Why a fragment identifier instead of a real page?

Because they are overusing Ajax. Instead of linking to a new page, they link to a non-existent or dynamically generated fragment of the current page and then use JavaScript to change the content.

Why start the fragment identifier with !

Because Google will map it onto a different URL so you can serve up a special alternative version just for them. This allows the content to be indexed by search engines.

like image 179
Quentin Avatar answered Feb 15 '23 10:02

Quentin