AddDefaultCharset UTF-8

AddType application/x-font-ttf           ttc ttf
AddType application/x-font-otf           otf
AddType application/font-woff            woff
AddType application/font-woff2           woff2
AddType application/vnd.ms-fontobject    eot

<FilesMatch ".(eot|ttf|otf|woff|woff2)">
  Header set Access-Control-Allow-Origin "*"
</FilesMatch>

<Files ~ "\.js\.map">
    Require all denied

	<RequireAll># Sentry whitelist (https://docs.sentry.io/ip-ranges/)
	    Require ip 35.184.238.160/32
	    Require ip 104.155.159.182/32
	    Require ip 104.155.149.19/32
	    Require ip 130.211.230.102/32
	</RequireAll>
</Files>

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ ?_url=/$1 [QSA,L]

	#######################################################################
	# GENERAL                                                             #
	#######################################################################

	# Make apache follow sym links to files
	Options +FollowSymLinks
	# If somebody opens a folder, hide all files from the resulting folder list
	IndexIgnore */*

	#######################################################################
	# REWRITING                                                           #
	#######################################################################

	# Enable rewriting
	RewriteEngine On

	# If its not HTTPS
	### RewriteCond %{HTTPS} off

	# Comment out the RewriteCond above, and uncomment the RewriteCond below if you're using a load balancer (e.g. CloudFlare) for SSL
	# RewriteCond %{HTTP:X-Forwarded-Proto} !https

	# Redirect to the same URL with https://, ignoring all further rules if this one is in effect
	### RewriteRule ^(.*) https://%{HTTP_HOST}/$1 [R,L]

	# If we get to here, it means we are on https://

	# If the file with the specified name in the browser doesn't exist
	RewriteCond %{REQUEST_FILENAME} !-f

	# and the directory with the specified name in the browser doesn't exist
	RewriteCond %{REQUEST_FILENAME} !-d

	# and we are not opening the root already (otherwise we get a redirect loop)
	RewriteCond %{REQUEST_FILENAME} !\/$

	# Rewrite all requests to the root
	RewriteRule ^(.*) /

</IfModule>
