ServerName faved DocumentRoot "/var/www/html/public" XSendFilePath "/var/www/html/public" RewriteEngine On # Serve existing files or directories directly RewriteCond %{DOCUMENT_ROOT}/dist%{REQUEST_URI} -f [OR] RewriteCond %{DOCUMENT_ROOT}/dist%{REQUEST_URI} -d RewriteRule ^(.*)$ /dist/$1 [L] # Redirect '/api' prefixed path to api/index.php RewriteRule ^/api(/.*|)$ api/index.php [L] RewriteRule ^/content(/.*|)$ api/index.php [L] # Redirect all other paths to index.html RewriteRule ^ dist/index.html [L] Options Includes FollowSymLinks ExecCGI AllowOverride All Order allow,deny Allow from all