如何处理angularjs应用程序中的页面重新加载在laravel中不存在的url

How to handle page reload in AngularJS app for URL that doesn't exist in Laravel routes

I don't know how to bump but I have the exact same problem as this guy and looks like his question didn't get answered.

I'm using angular 1.4.8 and laravel 5.2.

  1. If I load the page "home.php" it works(shows home content and "main" content).
  2. I press a link to open home/info and it works and I see the info page loaded with angular routes.
  3. Now if I refresh this I get an error(Not found exception).

    How can I fix this in laravel?

My angular routes for home.php:

app.config(function($routeProvider, $locationProvider) {
    $locationProvider.html5Mode(true).hashPrefix('!');
    $routeProvider
    .when('/', {
        templateUrl : '/main'
    })

    .when('/info', {
        templateUrl : '/info'
    });
});`

Laravel routes:

Route::get('home', function () {
    return view('home');
});

Route::get('main', function () {
    return view('main');
});

Route::get('info', function () {
    return view('info');
});

So what's not working: I can't go directly to home/info(or refresh it). I can only go to home, then press link to home/info to see it. It should load home page with info page loaded(with angular routes).