<IfModule mod_alias.c>
	# by default disallow access to the base git folder
	RedirectMatch /\.git(/|$) /404
</IfModule>

# cache images for a while
<IfModule mod_expires.c>
	ExpiresActive On
	ExpiresByType text/css "access plus 1 month"
	ExpiresByType text/javascript "access plus 1 month"
	ExpiresByType image/gif "access plus 1 month"
	ExpiresByType image/jpg "access plus 1 month"
	ExpiresByType image/png "access plus 1 month"
</IfModule>

# compress output if we can
<IfModule mod_deflate.c>
	# Set output filter for zipping content
	SetOutputFilter DEFLATE
	# Netscape 4.x and 4.06-4.08 have issues
	BrowserMatch ^Mozilla/4 gzip-only-text/html
	BrowserMatch ^Mozilla/4\.0[678] no-gzip
	# MSIE can be an issue, for now catch all MSIE
	BrowserMatch \bMSIE[56] !no-gzip !gzip-only-text/html
	# Exclude file types from compression
	SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png|pdf|zip|tar|rar|gz|dmg|mp3|mp4|m4a|m4p|mov|mpe?g|qt|swf)$ no-gzip dont-vary
	# Make sure proxy servers deliver what they're given
	<IfModule mod_headers.c>
		Header append Vary User-Agent env=!dont-vary
	</IfModule>
</IfModule>

<IfModule mod_rewrite.c>
	RewriteEngine ON

	# Set this if you have your installation in a subdirectory
	# RewriteBase /openvbx

	# By default always use SSL
	#RewriteCond %{HTTPS} !=on
	#RewriteRule ^(.*) https://%{SERVER_NAME}%{REQUEST_URI} [L,R]

	RewriteCond %{REQUEST_FILENAME} !-f
	RewriteCond %{REQUEST_FILENAME} !-d

	RewriteRule ^(.*) index.php?vbxsite=$1 [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L,QSA]
	#RewriteRule ^(.*) index.php/$1 [L,QSA]

	ErrorDocument 404 /fallback/rewrite.php
</IfModule>