【发布时间】:2018-04-23 02:37:30
【问题描述】:
我在尝试在第二级刷新我的页面时遇到问题,当通过这样的路由角度设置参数时:
localhost/ADMIN/page/1
在哪里
localhost/BASE_FOLDER/ROUTE/ROUT_PARAM
所以,我在我的路由应用程序中定义了这个:
app.config(['$routeProvider','$locationProvider',function($routeProvider,$locationProvider) {
$routeProvider.
when('/home', {
templateUrl: 'template/home.html',
controller: 'homeController'
})
.when('/page', {
templateUrl: 'template/page-list.html',
controller: 'pageListController'
})
.when('/page/:id', {
templateUrl: 'template/page-details.html',
controller: 'pageDetailsController'
})
.when('/', {
redirectTo: 'home'
})
.otherwise({
redirectTo: '404'
});
$locationProvider.html5Mode(true);
$locationProvider.hashPrefix('');
}]);
所以刷新的问题只有在/page/:id for rewrite rules 的时候才会有错误,我确定,但是我找不到错误,希望你能看到,谢谢。
RewriteEngine on
RewriteBase /ADMIN/
# Don't rewrite files or directories
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
# Redirect urls without a trailing slash
RewriteRule ^(.*)/$ $1 [L,R=301]
# Rewrite everything else to index.html to allow html5 state links
RewriteRule ^ index.html [L]
这是错误,但看不到。页面全部显示
【问题讨论】:
标签: javascript php angularjs .htaccess