问题
I try to use Codeigniter with AngularJS routing, and it's working, but I need without hash. I use this code:
.config(['$routeProvider', '$locationProvider', function ($routeProvider, $locationProvider) { $locationProvider.html5Mode(true); $routeProvider. when('/', { templateUrl: 'assets/js/partials/blank.html' }). when('/:name', { templateUrl: 'assets/js/partials/blank.html', controller: PagesController }). otherwise({redirectTo: '/'}); }]);
but when I refresh the page, jumps to 404.
回答1:
You can always set the $route['404_override'] = ''
to you default controller. This way it will not be 404.
来源:https://stackoverflow.com/questions/28374407/codeigniter-angularjs-routing-causes-404