Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an ajax webapp i'd like to make indexable to google.

My paths use the hashbang, and look like:


Considering the infinite ways of the web, it could also be that my URLS look like the following:


I have files that contain the markup as should be visible by the search engines in a folder called "fragments" which is at the root level of the website's documentroot.

These are organized by folders, such as:

/fragments/en/ -> containing a file called news 


/fragments/en/ -> /news , containg a file called news-item-name 

Google requests the files as ?_escaped_fragment_ , as according to

I need to create apache rewrite rules, that map a request for , for example,

to the according file on my filesystem (/fragments/en/news/news-item-name), so that the snapshot can be served to the crawler.

I've currently got the following rules in place:

RewriteEngine On
RewriteCond %{QUERY_STRING} ^_escaped_fragment_=(.*)$
RewriteRule ^$ /fragments/%1

These unfortunately are not able to deal with the folder structure, and they just look for a file in the fragments directory.

share|improve this question
Solved the issue. RewriteCond %{QUERY_STRING} ^_escaped_fragment_=(.*)$ RewriteRule ^(.*) /fragments/%1 did the trick. – DLeonardi Nov 5 '12 at 14:55

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.