2
我已为我的应用启用了HTML5模式。我已经把下面的代码的配置,如下图所示重新加载页面启用AngularJS HTML5模式后显示404错误消息
return app.config(['$routeProvider','$locationProvider', function($routeProvider,$locationProvider) {
$locationProvider.html5Mode(true);
$locationProvider.hashPrefix = '!';
$routeProvider.when('/', {
templateUrl: '/pages/index.html',
controller: 'indexCtrl'
});
$routeProvider.when('/about',{
templateUrl: '/pages/about.html',
controller: 'AboutCtrl'
});
而且我已经做在.htaccess文件中的一些变化,如下
RewriteEngine On
Options FollowSymLinks
RewriteBase/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /#/$1 [L]
而且我已经做了index.html中的一些变化也liek
<base href="/">
是我没有设定,这也 –