Options -Indexes
RewriteEngine On
RewriteBase /Triangle_Tree_Life_Number/api/

# ─── Pass Authorization header to PHP ────────
# Apache often strips this — these lines fix it
SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
CGIPassAuth On

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

# Allow real files to be served directly
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]

# Route everything else to index.php
RewriteRule ^ index.php [QSA,L]
