I am developing a project using Laravel 5 and AngularJS. I want to enable
$locationProvider.html5Mode(true);
and stop page reloading. The page does not reload when I set it to false and go to the link.
Here is my route.php
Route::get('/', function () { return View::make('index'); });
Angular code
app.config(function($routeProvider, $locationProvider) { $routeProvider.when('/', { templateUrl: 'views/feed.html', controller: 'fdController' }).when('/collections', { templateUrl : 'views/collections.html', controller: 'clController' }).otherwise({ redirectTo : '/' }); $locationProvider.html5Mode(true); });
When I find the link html5Mode(false) localhost:8000/#/ -> localhost:8000/#/feed page is not updated
When html5Mode(true) and I visit localhost:8000/ -> localhost:8000/feed , the page refreshes and I get this error:
Sorry, the page you are looking for was not found.
source share