<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /broker-portal/
    
    # Handle API requests - redirect to Laravel
    RewriteRule ^api/(.*)$ api/public/index.php [L]
    
    # Handle Frontend SPA - all non-file requests go to index.html
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.html [L]
</IfModule>

# Prevent directory listing
Options -Indexes

# Security headers
<IfModule mod_headers.c>
    Header always set X-Content-Type-Options nosniff
    Header always set X-Frame-Options SAMEORIGIN
</IfModule>
