Angularjs 带ui路由器和浏览器化的角度HTML5模式
第一次使用browserify和Angular模块导出,我通常的HTML5模式设置不起作用 app.jsAngularjs 带ui路由器和浏览器化的角度HTML5模式,angularjs,angular-ui-router,browserify,Angularjs,Angular Ui Router,Browserify,第一次使用browserify和Angular模块导出,我通常的HTML5模式设置不起作用 app.js .config(function myAppConfig($stateProvider, $urlRouterProvider, $locationProvider) { $urlRouterProvider.otherwise('/'); $locationProvider.html5Mode(true); }) index.html <head> .
.config(function myAppConfig($stateProvider, $urlRouterProvider, $locationProvider) {
$urlRouterProvider.otherwise('/');
$locationProvider.html5Mode(true);
})
index.html
<head>
...
<base href="/">
</head>
<ifModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !index
RewriteRule (.*) index.html [L]
</ifModule>