title: How to define a default route in AngularJS?
body: <p>I am trying to define a default route when angularjs hits the below url</p>
  
  <p><a href="http://localhost:62831/#/" rel="nofollow noreferrer">http://localhost:62831/#/</a></p>
  
  <p>The default route should go to home page below.</p>
  
  <p><a href="http://localhost:62831/" rel="nofollow noreferrer">http://localhost:62831/</a></p>
  
  <p>How can I define it using $urlRouterProvider ? The below line does not seem to be making any difference.</p>
  
  <pre><code>$urlRouterProvider.otherwise('/');
  </code></pre>
  
  <p>Any suggestions? Thank you!</p>
  
  <pre><code> appl.config(['$stateProvider', '$urlMatcherFactoryProvider', '$locationProvider', '$urlRouterProvider',
      function ($stateProvider, $urlMatcherFactoryProvider, $locationProvider, $urlRouterProvider) {
  
          $urlMatcherFactoryProvider.caseInsensitive(true);
  
          $stateProvider
              .state('home', {
                  url: '',
                  templateUrl: 'search',
                  controller: 'applCtrl'
              })
              .state('person', {
                  url: '/person',
                  templateUrl: 'Person',
                  controller: 'applPersonCtrl'
              })
  
          $urlRouterProvider.otherwise('/');
  
          $locationProvider.hashPrefix(''); //it defaults to ! after angularjs 1.5
  
      }]);
  </code></pre>