# Alias /hedera-web /usr/share/hedera-web/
# Alias /image-db /var/lib/hedera-web/image-db/

<IfModule mod_mime.c>
	AddType text/x-yaml .yml
</IfModule>

<Directory /usr/share/hedera-web/>
	Options -Indexes -FollowSymLinks
	AllowOverride None
	Require all granted
	
	<FilesMatch "\.(css|js|json|yml|php|xml|html|svg)$">
		SetOutputFilter DEFLATE
	</FilesMatch>
	
	<FilesMatch "\.(ttf|otf|eot|woff)$">
		<IfModule mod_headers.c>
			Header set Access-Control-Allow-Origin "*"
		</IfModule>
	</FilesMatch>
</Directory>

<Directory /var/lib/hedera-web/image-db/>
	Options +Indexes +FollowSymLinks
	Require all granted
</Directory>

<Directory /var/lib/hedera-web/image-db/*/*>
	Options -Indexes -MultiViews +FollowSymLinks
	AllowOverride FileInfo Options
	Require all granted

	<IfModule mod_headers.c>
		RewriteEngine On
		RewriteBase /
		RewriteCond %{REQUEST_FILENAME} !\.[a-zA-Z0-9]+$
		RewriteRule ^(.+)$ %{REQUEST_URI}.png [L]
	</IfModule>
</Directory>