<IfModule mod_negotiation.c>
    Options -MultiViews -Indexes
</IfModule>

Header set Access-Control-Allow-Origin "*"
Header set Access-Control-Allow-Methods "GET,PUT,POST,DELETE,PATCH,OPTIONS"
Header set Access-Control-Allow-Headers "Accept, Accept-Language, Authorization, Cache-Control, Content-Disposition, Content-Type, Origin, User-Agent, X-Requested-With"
Header set Access-Control-Allow-Credentials "true"
Header set Access-Control-Expose-Headers "Content-Disposition"
Header set Access-Control-Max-Age "86400"

RewriteEngine On

# Disable OPTIONS requests into framework
RewriteCond %{REQUEST_METHOD} OPTIONS
RewriteRule .* empty.html [NC,L]

# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]

# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
