title: Routing in subdirectory in Angular.js
body: <p>Is it possible to develop an Angular.js application in a way that would be abstracted from the the web directory path in which it will be deployed?</p>
  
  <p>I am trying to put an Angular.js app in a web server subdirectory <a href="http://example.com/myproject/" rel="noreferrer">http://example.com/myproject/</a>, but the router redirects me to the web server root -- <a href="http://example.com" rel="noreferrer">http://example.com</a>.</p>
  
  <p>Below is my Angular.js app:</p>
  
  <pre class="lang-js prettyprint-override"><code>var myproject = angular.module('myproject', []);
  
  myproject.config(function($routeProvider, $locationProvider) {
    $routeProvider.
      when('/', {templateUrl: 'partials/index.html', controller: IndexCtrl}).
      otherwise({redirectTo: '/'});
  
    $locationProvider.html5Mode(true);
  });
  
  
  
  function IndexCtrl($scope, $location) {
  
  }
  </code></pre>