<IfModule mod_rewrite.c>
    Options -Indexes
    RewriteEngine On

    # Serve existing files/directories
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f

    # Send everything else to the Laravel front controller
    RewriteRule ^ index.php [L]
</IfModule>

# Fallback: prevent directory listing if mod_rewrite is unavailable
<IfModule !mod_rewrite.c>
    Options -Indexes
</IfModule>
