For my webpage I generate the content via JavaScript, so I want to use ?_escaped_fragment_ to redirect Google to my HTML snapshot.

I have a RewriteRule for my Apache

 RewriteEngine on
 RewriteCond %{REQUEST_URI}  ^/$
 RewriteCond %{QUERY_STRING} ^_escaped_fragment_=/?(.*)$
 RewriteRule ^(.*)$ /snapshot/.snapshot_.html [NC,L]

Which redirects ?_escaped_fragment_= to /snapshot/.snapshot_.html (http://example.com/?_escaped_fragment_=). This works fine.

I also added <meta name="fragment" content="!"> to my homepage.

When I do "Fetch as Google" in my Webmaster Tools, it doesn't fetch the content of the ugly url but from example.com.

Is there anything I did not consider?

  • Does your website really only have a single snapshot? Most AJAX websites would have many snapshots. Dec 10 '14 at 18:24
  • yep, its just one page without any internal links Dec 18 '14 at 9:10
  • So why are you using AJAX at all? If you just have one piece of content, shouldn't you just have a static page? Dec 18 '14 at 10:55
  • I just said AJAX to point out that its async. Actually it's a template engine rendering my page. It basically comes down to the same thing. Dec 19 '14 at 9:54

"Fetch as Google" does not fetch the same way as Google does. "Fetch as Google" doesn't check the page for the meta tag. (The crawling algorithm does)

A workaround is adding it manually in the "fetch as Google" statement. ex:



Google's John Mueller answered a similar question in the Google Product Forums:

For URLs that use the AJAX-crawling scheme, you need to submit the "escaped-fragment" versions in Fetch as Google. The "hash-bang" URLs themselves won't work there.

It appears that "Fetch as Google" isn't able to handle hash bang URLs or fragment meta tags.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.