<IfModule mod_rewrite.c>
    RewriteEngine On
    
    # Pass Authorization Header to PHP
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    # Only route API requests to the public/index.php router
    # This allows direct access to the views/ and assets/ folders for the web interface
    RewriteRule ^api/(.*)$ public/index.php [QSA,L]
</IfModule>
