Options +FollowSymLinks -MultiViews
RewriteEngine On

# --- Temporary diagnostic route: confirms mod_rewrite is actually being
# applied at all. Hit https://test.afribid.co/ping -- if this 404s too,
# the problem is server-side .htaccess handling, not our specific rules.
# Delete this block once routing is confirmed working.
RewriteRule ^ping$ api/health.php [L]

# POST /api/didit/session  ->  api/didit-session.php
RewriteRule ^api/didit/session$ api/didit-session.php [L,QSA]

# POST /api/didit/webhook  ->  api/didit-webhook.php
RewriteRule ^api/didit/webhook$ api/didit-webhook.php [L,QSA]

# GET /health  ->  api/health.php
RewriteRule ^health$ api/health.php [L,QSA]

# Never serve these directly
<FilesMatch "^(config\.php|\.env)$">
    Require all denied
</FilesMatch>
