<VirtualHost *:9080>
# Vue.js Single Page Application
DocumentRoot /var/www/app/dist
<Directory "/var/www/app/dist">
Options -Indexes +FollowSymLinks
AllowOverride All
Require all granted
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]
</Directory>
# PHP API
Alias "/api" "/var/www/app/api"
<Directory "/var/www/app/api">
Options -Indexes +FollowSymLinks
AllowOverride All
Require all granted
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [L]
</Directory>
</VirtualHost>
En un caso como este todas las peticiones a la API van a dominio.com/api/XXXXX