ui-router中增加
$locationProvider.html5Mode(true);
2.根目录增加.htaccess文件,并增加
RewriteEngine On# If an existing asset or directory is requested go to it as it isRewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR]RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -dRewriteRule ^ - [L]# If the requested resource doesn‘t exist, use index.htmlRewriteRule ^ /index.html
3.在index.html的head标签中增加
<base href="/">
4.若刷新页面后样式失效,请查看是否路径为"./abc"写法,改写成绝对路径"/abc"
angularjs ui-router路由移除#解决方案
原文地址:http://rozwel.blog.51cto.com/13020465/1964243