问题
I have created a Single Page Application using Angular 8 which consumes a backend API build using Laravel. Everything is working well on my local machine. Now I want to upload it on a shared hosting via CPanel. I have started by uploading the backend Laravel project inside a subfolder in public_html folder called test-app.
This is because I have configured my domain settings to have a subdomain which points to this subfolder. So basically when a user types test-app.example.com it points to this subfolder where I want the SPA to sit on, if the user types example.com it points to my main website.
Next I have run ng-build on my Angular project locally and the contents have been compiled into a dist folder. I have uploaded the dist folder onto the server but am not sure where to place it in my Laravel project so that when the user types test-app.exmaple.com the 1st page on the SPA opens. I want it to consume the API endpoints of the Laravel project it is sitting on.
My .htaccess file
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^(.*) index.html [NC,L]
</IfModule>
来源:https://stackoverflow.com/questions/56912868/uploading-an-angular-8-project-and-laravel-on-shared-hosting