# ==============================================================================
# PayoutFlow PHP - Apache / cPanel URL Routing (.htaccess)
# ==============================================================================

RewriteEngine On
RewriteBase /

# 1. Route /api/* requests to api/index.php
RewriteRule ^api/(.*)$ api/index.php [QSA,L]

# 2. Route /admin to admin.html
RewriteRule ^admin/?$ admin.html [L]

# 3. Serve real static files directly
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]

# 4. Fallback: Serve index.html
RewriteRule ^ index.html [L]

# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php81” package as the default “PHP” programming language.
<IfModule mime_module>
  AddHandler application/x-httpd-ea-php81 .php .php8 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
