RewriteEngine On

# Preserve the connector Authorization: Bearer header on cPanel/LiteSpeed/Apache.
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

# Block direct access to private implementation/config files.
<FilesMatch "^(config|lib|cron)\.php$">
    Require all denied
</FilesMatch>

# Route connector/API calls through index.php.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [QSA,L]
