4

I have recently read Google's Making AJAX Applications Crawlable as I was wondering how to correctly prepare my dynamic site, which uses hashbang navigation, for SEO. I understand now that for mysite.com/#!/foobar I should serve an equivalent html snapshot at mysite.com/?_escaped_fragment_=foobar.

I just want to know if google then correctly indexes my page as http://example.com/#!/foobar or if it uses this escaped_fragment url? I'm assuming (but would like to be sure) it will correctly use my hashbang url for the search results but that the indexed content was taken from the escaped_fragment page.

Some confirmation would help me sleep better. thanks

rewolf
  • 5,561
  • 4
  • 40
  • 51
  • I think that's more or less the purpose of it yes. Slightly off topic - I absolutely hate this design pattern, it's hugely irritating when browsing with no-script and I generally avoid sites that use it for that reason alone. – Vala Oct 31 '11 at 13:23
  • Agreed. Using this to load your page content is a [very bad idea](http://isolani.co.uk/blog/javascript/BreakingTheWebWithHashBangs). – John Conde Oct 31 '11 at 13:36
  • Thanks. What navigation techniques would you recommend for AJAX sites or other dynamic sites where states should be bookmarkable etc, in that case? – rewolf Oct 31 '11 at 14:05
  • 3
    and just for interest's sake, why do you browse with no-script? – rewolf Oct 31 '11 at 14:11
  • 1
    Fix url: https://developers.google.com/webmasters/ajax-crawling/ – Totty.js Sep 05 '14 at 10:49

1 Answers1

0

By default, google will create escaped_fragment url for your page. That could end up looking ugly.

You should redirect escaped_fragment url to a page page with a prettier url using 301

Say your server gets a URL request from googlebot/any hashbang compliant crawler such as "targetPage?_escaped_fragment_=command=play%26id=4ee7af"

You should have your targetPage accepts targetPage?_escaped_fragment_= .... and created a 301 redirect to itself as "targetPage?command=play&id=4ee7af" ( or any other pretty url as long as it is to the same page)

If you were using J2EE you could create a servlet filter to intercept and 301 redirect to cleaner url of the same page.

user193116
  • 3,498
  • 6
  • 39
  • 58