# Deny browse directory
Options -Indexes

# Handle errors
ErrorDocument 405 /error-405.html
ErrorDocument 500 /error-500.html

<IfModule mod_rewrite.c>
	RewriteEngine On

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

	# Allow only the following request methods
	RewriteCond %{REQUEST_METHOD} !^(GET) [NC]
	RewriteRule .* - [F,L,R=405]
	Header add Access-Control-Allow-Methods "GET, HEAD"
	Header add Allow "GET, HEAD"

	# Handle redirects
	# [status] [original] [updated]

	# Redirect to trailing slash if not folder or file
	RewriteCond %{REQUEST_URI} /+[^\.]+$
	RewriteRule ^(.+[^/])$ %{REQUEST_URI}/ [R=301,L]

    # Send Requests To Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>
