Trasa główna w routerze ui

używamhttps://github.com/angular-ui/ui-router biblioteka. Gdy próbuję uzyskać dostęp do trasy indeksu („/”), przekierowuję do 404. Kod:

angular.module('cr').config(function($stateProvider, $urlRouterProvider) {
    $stateProvider
        .state('home', {
            url: '/',
            templateUrl: 'views/index.html'
        });

    $urlRouterProvider.otherwise('/404');
});

Co jest nie tak z tym kodem? Chociaż kiedy używam ui-sref = „home” to działa, ale adres URL wygląda jak „/ # /”, ale gdy użytkownik wprowadza nazwę witryny, używa tylko nazwy domeny, np. „Mysite.com”, a nie „mysite.com/# / '

questionAnswers(4)

yourAnswerToTheQuestion