tomcat apache 8.5.4中的角度html5mode在页面刷新上给出404 [英] angular html5mode in tomcat apache 8.5.4 gives 404 on page refresh
本文介绍了tomcat apache 8.5.4中的角度html5mode在页面刷新上给出404的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用gulp-war创建war文件,并将其部署到系统上的tomcat apache服务器8.5.4中
I m creating war file using gulp-war and deploy it into tomcat apache server 8.5.4 on my system
它首先在localhost:8080/projectName/
,但是每当刷新页面时,它就会显示 404错误.如何解决此问题?
but whenever I refresh the page it gives 404 error . How to fix this issue?
如果我从配置文件中删除了$locationProvider.html5Mode(true);
,并且比创建war文件好了,那么它就可以正常工作了
if I remove $locationProvider.html5Mode(true);
from config file and than creat war file than it working fine
一切正常,但URl随附/#/
than everything works fine but URl comes with /#/
我尝试添加.htaccess
文件,但没有区别
I tried with adding .htaccess
file but no difference
有人解决吗?
推荐答案
希望它对某人有帮助
这篇关于tomcat apache 8.5.4中的角度html5mode在页面刷新上给出404的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文