# php handler
<IfModule mime_module>
  AddHandler application/x-httpd-ea-php83 .php .php8 .phtml
</IfModule>

<IfModule mod_rewrite.c>
RewriteEngine On

# Allow direct access to static files and directories
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]

# Route /api requests through api-proxy.php
RewriteCond %{REQUEST_URI} ^/api
RewriteRule ^(.*)$ api-proxy.php [QSA,L]

# Serve HTML files for routes
RewriteRule ^login$ /login.html [L]
RewriteRule ^register$ /register.html [L]
RewriteRule ^about$ /about.html [L]
RewriteRule ^themes$ /themes.html [L]
RewriteRule ^$ /index.html [L]

# 404 for everything else
RewriteRule ^ /404.html [L]
</IfModule>

# Disable directory listing
Options -Indexes
