Options -Indexes

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /api/

  # Stop Apache from forcing a trailing slash on "directory-like" routes (e.g., /api/me)
  DirectorySlash Off

  # Serve real files directly (e.g., /api/uploads/..., /api/sample/...)
  RewriteCond %{REQUEST_FILENAME} -f
  RewriteRule ^ - [L]

  # Everything else goes to the front controller
  RewriteRule ^ index.php [L,QSA]
</IfModule>
