1

The google guide Making AJAX Applications Crawlable tells how to format your url with hash an ! in order to make your site crawlable. A good example for that is the new twitter. If you type the URL:

http://twitter.com/dinizz

You will be redirected to:

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

I realized that the redirection is made on the server side, because i have tried to do with javascript and turns to every time that i'd change the url the browser reloads the page, i am trying to do on the server side with Ruby on Rails without success.

any help?

UPDATE: I found another question that address the same problem: How to show Ajax requests in URL?

Community
  • 1
  • 1
Thiago Diniz
  • 3,041
  • 5
  • 30
  • 35

1 Answers1

1

This can't be sensibly done server side.

What should happen is that a client without JS will request the page, and then get data they can use.

If you redirect server side, then they will request the page, get a redirect to the homepage with a fragment identifier, and then get the default content of the homepage.

You have to do the redirect in JS on the client side.

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
  • Hi David, in twitter response header the status Code is 302 Found wich means that the redirect was in the server side. – Thiago Diniz Nov 01 '10 at 15:45
  • It looks like they are doing user-agent sniffing; so when I try it with JS blocked, I get redirected to a blank page. Twitter's approach is stupid and not something you should emulate. – Quentin Nov 01 '10 at 15:51
  • So are you saying you should first send down a non-JavaScript page with a small JS redirect so if the client does have JS the redirect script will run and redirect to a JS powered version? –  Jan 30 '11 at 16:57