AddDefaultCharset utf-8

Options +FollowSymLinks
RewriteEngine On

# Prevent recursion
RewriteRule ^dispatch\.fcgi/.*$ - [L]
RewriteRule ^__public/.*$ - [L]
{{for s in statics.split(';')}}
RewriteRule ^{{s}}/.*$ - [L]
{{endfor}}

# Get the local directory path and file that we're searching for
RewriteCond %{REQUEST_FILENAME} ^(.*?)/([^/]*)$
# If that file exists in ./__public
RewriteCond %1/__public/%2%{PATH_INFO} -f
# Then serve it directly
RewriteRule ^(.*)$ __public/$1 [L]

# Use FCGI for everything else
RewriteRule ^(.*)$ dispatch\.fcgi/$1 [L]
