5

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?

4
  • Does your website really only have a single snapshot? Most AJAX websites would have many snapshots. Commented Dec 10, 2014 at 18:24
  • yep, its just one page without any internal links Commented Dec 18, 2014 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? Commented Dec 18, 2014 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. Commented Dec 19, 2014 at 9:54

2 Answers 2

4

"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:

www.example.com/?_escaped_fragment_=

2
1

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 and acknowledge you have read our privacy policy.

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