我有 Apache 服务器,它在 下运行 Angular 6 应用程序/var/www/html/<angular_root>
。我尝试添加一个文件夹/var/www/html/admin/<angular_root>
,但出现错误Failed to load resource: the server responded with a status of 404 (Not Found)
。你知道我需要实现什么配置吗?
我当前的 apache 配置是:
<Directory /var/www/html/admin>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
Run Code Online (Sandbox Code Playgroud)
您的角度项目(s base href 是错误的。部署应用程序时,请在 cmdline 上指定 base-href :
ng build --prod --base-href ./
Run Code Online (Sandbox Code Playgroud)
供参考https://angular.io/guide/deployment