angularjs ui-router路由移除#解决方案
ui-router中增加
$locationProvider.html5Mode(true);
2.根目录增加.htaccess文件,并增加
RewriteEngineOn#IfanexistingassetordirectoryisrequestedgotoitasitisRewriteCond%{DOCUMENT_ROOT}%{REQUEST_URI}-f[OR]RewriteCond%{DOCUMENT_ROOT}%{REQUEST_URI}-dRewriteRule^-[L]#Iftherequestedresourcedoesn'texist,useindex.htmlRewriteRule^/index.html
3.在index.html的head标签中增加
<basehref="/">
4.若刷新页面后样式失效,请查看是否路径为"./abc"写法,改写成绝对路径"/abc"
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。