angularjs ui-router路由移除#解决方案
发布时间:2020-12-17 08:54:21 所属栏目:安全 来源:网络整理
导读:ui-router中增加 $locationProvider.html5Mode(true); 2.根目录增加.htaccess文件,并增加 RewriteEngineOn#IfanexistingassetordirectoryisrequestedgotoitasitisRewriteCond%{DOCUMENT_ROOT}%{REQUEST_URI}-f[OR]RewriteCond%{DOCUMENT_ROOT}%{REQUEST_URI
$locationProvider.html5Mode(true); 2.根目录增加.htaccess文件,并增加 RewriteEngineOn #Ifanexistingassetordirectoryisrequestedgotoitasitis RewriteCond%{DOCUMENT_ROOT}%{REQUEST_URI}-f[OR] RewriteCond%{DOCUMENT_ROOT}%{REQUEST_URI}-d RewriteRule^-[L] #Iftherequestedresourcedoesn'texist,useindex.html RewriteRule^/index.html 3.在index.html的head标签中增加 <basehref="/"> 4.若刷新页面后样式失效,请查看是否路径为"./abc"写法,改写成绝对路径"/abc" (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |