title: Angular UI-Router Thinks Every URL Is Unmatched And Redirects
body: <p>In my HTML, I have the following two links, but when I click them or try to enter them into the browser, my new ui-router code is redirecting them to the <code>otherwise</code> url I have specified.  Why is this?</p>
  
  <pre><code>&lt;a href="http://localhost:3000/#!/folders/529ece6bf0686d1717000003"&gt;Folders&lt;/a&gt;
  &lt;a href="http://localhost:3000/#!/clients"&gt;Clients&lt;/a&gt;
  
  //Setting up route
  window.app.config(function($stateProvider, $urlRouterProvider) {
  
      // For any unmatched url, redirect to "/"
      $urlRouterProvider.otherwise("/asfasfsa");
      // Now set up the states
      $stateProvider
          .state('root', {
            url: "/",
            templateUrl: 'views/index.html',
            resolve: { factory: setRoot }
          })
          .state('dashboard', {
            url: "/dashboard",
            templateUrl: 'views/dashboard/dashboard.html',
            resolve: { factory: checkAuthentication }
          })
          .state('folders-show', {
            url: "/folders/:folderId'",
            templateUrl: 'views/dashboard/folders/view.html',
            resolve: { factory: checkAuthentication }
          })
          .state('clients-list', {
            url: "/clients'",
            templateUrl: 'views/clients/list.html',
            resolve: { factory: checkAuthentication }
          })
  
  });
  
      // Check if user is logged in
  var checkAuthentication = function ($q, $location) {
      if (window.user) {
          console.log(window.user);
          return true;
      } else {
          console.log("Not logged in...")
          var defered = $q.defer();
          defered.reject();
          $location.path("/");
          return defered.promise;
      }
  };
  
  // Set Root URLs
  var setRoot = function ($q, $location) {
      if (window.user) {
          var defered = $q.defer();
          defered.reject();
          $location.path("/dashboard");
          return defered.promise;
      } else {
          return true;
      }
  };
  
  
  // Setting HTML5 Location Mode
  window.app.config(['$locationProvider',
      function($locationProvider) {
          $locationProvider.hashPrefix("!");
      }
  ]);
  </code></pre>