title: Angular Js is removing Sub-Directory from URL
body: <p>I have installed my Angular App in a location like this:
  <code>http://example.com/my-app</code></p>
  
  <p>My App routing is like this:</p>
  
  <pre><code>var myApp = angular.module('myApp', ['ngRoute','ngAnimate', 'ui.bootstrap', 'angularFileUpload']);
  
  myApp.config(['$routeProvider', function($routeProvider) {  
  
      $routeProvider
          .when('/templates', {
              controller: 'TemplatesController',          
              templateUrl: '/components/com_myApp/myApp/views/templates/template-list.html'
          })  
  
          .when('/apps', {
              controller: 'AppController',            
              templateUrl: '/components/com_myApp/myApp/views/apps/app-list.html'
          })
  
          .otherwise({
              redirectTo: '/templates'    
          }); 
  
  }]);
  </code></pre>
  
  <p>Now what happens is, when I go to <code>http://example.com/my-app</code>, the url instead of showing <code>http://example.com/my-app#/templates</code> it is showing as <code>http://example.com/templates</code></p>
  
  <p>It seems the <code>otherwise</code> condition is basically removing the base directory <code>my-app#</code> from the url. I have been scratching my head over this and after reading I also tried adding base url to head tag and tried changing the <code>myApp.config</code> to this:</p>
  
  <pre><code>myApp.config(['$routeProvider', '$locationProvider', function($routeProvider, $locationProvider) {  
      $locationProvider.html5Mode(true);
  ....
  }
  </code></pre>
  
  <p>But although the routing seems to work when using <code>$locationProvider</code> like the above, the base url is still not showing the way I want it. The url is showing like this <code>http://example.com/templates</code> without <code>my-app</code> in the url path. I dont want Angular to remove the base path from the URL and I want the urls to show like this <code>http://example.com/my-app/..xyz...</code></p>
  
  <p>Why is Angular doing this?</p>