Header set Access-Control-Allow-Origin "*" RewriteEngine On #RewriteCond %{REQUEST_METHOD} OPTIONS RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f #RewriteCond %{REQUEST_URI} !^/index.php$ RewriteRule ^api(.*)$ /api/index.php [NC,L,QSA]