DirectoryIndex app.min.html
DirectoryIndex index.html

ErrorDocument 404 /404.html

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

RewriteRule  ^/?404.html$ /#/404 [NE,R,L]

#RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^/?data/posts/([^/]+)/? /api/posts/$1/content [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^/?data/thumbnails/(\d+)x(\d+)/posts/([^/]+)/? /api/posts/$3/thumbnail/$1 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^/?data/thumbnails/(\d+)x(\d+)/avatars/([^/]+)/? /api/users/$3/avatar/$1 [L]

RewriteRule ^/?api/(.*) api-dispatch.php?q=$0 [QSA,L]

<IfModule mod_mime.c>
AddType text/plain .tpl
</IfModule>

<IfModule mod_expires.c>
	ExpiresActive On
	ExpiresDefault "access plus 1 seconds"
	ExpiresByType text/html "access plus 1 seconds"
	ExpiresByType image/x-icon "access plus 1 year"
	ExpiresByType image/gif "access plus 1 year"
	ExpiresByType image/jpeg "access plus 1 year"
	ExpiresByType image/png "access plus 1 year"
	ExpiresByType text/css "access plus 1 year"
	ExpiresByType text/javascript "access plus 1 year"
	ExpiresByType application/javascript "access plus 1 year"
	ExpiresByType application/x-javascript "access plus 1 year"
</IfModule>

<ifModule mod_deflate.c>
	AddOutputFilterByType DEFLATE text/html text/xml text/css text/plain
	AddOutputFilterByType DEFLATE text/javascript application/javascript application/x-javascript application/json
</ifModule>
