title: .htacces redirect for AJAX search engine indexing
body: <p>Ok, so I made a pure html/javascript AJAX website, but I want my pages indexable by Google.
  I have my content files with meta information in plain html, but without menubar etc. and I have my index.htm with all the menubars, javascript AJAX stuff, etc.
  To make AJAX indexable for google, my URL's should look like "&lt;something&gt;#!&lt;somthingelse&gt;", which Google indexbot will change to "&lt;something&gt;?_escaped_fragment_=&lt;somethingelse&gt;", such that my server knows it should return the content directly, instead of the page that loads it via AJAX.
  However, since my server is stupid, as it doesn't use server side processing, I need to perform a trick via htaccess (which is where I fail :( )</p>
  
  <p>The idea is as following:
  I have my fancy URL's <a href="http://mysite.com/page1#!1" rel="nofollow">http://mysite.com/page1#!1</a>, <a href="http://mysite.com/page2#!1" rel="nofollow">http://mysite.com/page2#!1</a>, etc.
  Normally, htaccess should rewrite that to /index.htm?page=page1 such that my AJAX reads the URL param and automagically loads page1.htm content file.
  For Google indexer, it should ignore this rewrite for any url containing "?_escaped_fragment_=1" such that the url points to the content page directly
  This way I have to make a small compromise by putting #!1 in every fancy URL, but as far as I can think of, it is the only way to do this without server side processing (except for htaccess of course)</p>
  
  <p>I just cant seem to get the rewrite rules to do this.
  Here's what ive come up with so far:</p>
  
  <pre><code>RewriteEngine on
  RewriteCond %{QUERY_STRING} (^|.*&amp;)_escaped_fragment_=1(&amp;.*|$)
  RewriteRule ^(.*)$ %1 [L,R=301]
  RewriteRule ^(.*)$ /index.htm?page=%1 [L,R=301]
  </code></pre>