我将我的 routeProvider 设置为:
routeProvider.when('/', {templateUrl: 'views/index.html', controller: 'IndexCtrl'});
// $routeProvider.when('/ayat/:surah/:from/:to', {templateUrl: 'views/quran.html', controller: 'AyatCtrl'});
$routeProvider.when('/:id/:range?', {templateUrl: 'views/quran.html', controller: 'QuranCtrl'});
$routeProvider.when('/search?', {templateUrl: 'views/search.html', controller: 'SearchCtrl'});
$routeProvider.when('/about', {templateUrl: 'views/about.html'});
$routeProvider.when('/contact', {templateUrl: 'views/contact.html'});
$routeProvider.when('/sorry', {templateUrl: 'views/sorry.html'});
$routeProvider.otherwise({redirectTo: '/'});
$locationProvider.html5Mode(true);
})
每当我刷新页面时,我都会收到“未找到”
以前我没有遇到这个问题
$routeProvider.when('/:extension/:id/:range?', {templateUrl: 'views/quran.html', controller: 'QuranCtrl'});
$locationProvider.html5Mode(false);