问题:tomcat部署了react前端项目,可以正常访问,但是页面刷新就报404
一、问题截图
二、解决办法
在tomcat 配置文件web.xml中配置如下代码:
web.xml 路径: apache-tomcat-8.5\conf\web.xml
<error-page> <error-code>404</error-code> <location>/index.html</location> </error-page>
如图:
问题:tomcat部署了react前端项目,可以正常访问,但是页面刷新就报404
在tomcat 配置文件web.xml中配置如下代码:
web.xml 路径: apache-tomcat-8.5\conf\web.xml
<error-page> <error-code>404</error-code> <location>/index.html</location> </error-page>
如图:
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。