# Route all API requests to the router RewriteEngine On RewriteBase /api/ # Allow direct access to index.php RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d # Route everything to index.php RewriteRule ^(.*)$ index.php [QSA,L] # Deny access to helper files directly Require all denied Order deny,allow Deny from all