【发布时间】:2025-12-07 05:45:01
【问题描述】:
我想在 Tomcat 7 服务器上部署我的 Angular 5 应用程序,但是当我单击刷新按钮时出现重定向问题,我总是收到 404 错误。 在 Angular 网站上,我找到了 Apache:
RewriteEngine On
# If an existing asset or directory is requested go to it as it is
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d
RewriteRule ^ - [L]
# If the requested resource doesn't exist, use index.html
RewriteRule ^ /index.html
它适用于 Apache 服务器,但不适用于 Tomcat,Tomcat 是否有类似的配置? 谢谢
【问题讨论】:
-
我在网站上使用 Angular。
-
this 可能会有所帮助
标签: angular tomcat deployment