Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 https://developers.google.com/webmasters/ajax-crawling/docs/specification.

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. –  user436118 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.