title: HTML5 pushState Clash w/Angular UI-Router URL Routing
body: <p>I have an Angular.js webapp that employs ui-router (<a href="https://github.com/angular-ui/ui-router" rel="nofollow noreferrer">https://github.com/angular-ui/ui-router</a>) w/parallel named views like such:</p>
  
  <pre><code>.state(
              'app.experience', {
                  url: 'e/:experienceId',
                  views: {
                      'center-pane@': {
                          templateUrl: 'partials/experience.html',
                          controller: 'ExperienceController'
                      }
                  })
  </code></pre>
  
  <p>I enabled HTML5 pushState via </p>
  
  <pre><code>$locationProvider.html5Mode(true);
  </code></pre>
  
  <p>When</p>
  
  <pre><code>http://www.mysite.com/e/123
  </code></pre>
  
  <p>is requested, my backend sends back the index.html at the root directory. (as per <a href="https://stackoverflow.com/questions/11095179/using-html5-pushstate-on-angular-js">Using HTML5 pushstate on angular.js</a>) However, when the browser receives index.html and begins to fetch all the css/js resources, the requests are for</p>
  
  <pre><code>/e/js/script1.js
  </code></pre>
  
  <p>as opposed to</p>
  
  <pre><code>/js/script1.js
  </code></pre>
  
  <p>which only exists at the root level. It seems to default the root directory as <code>mysite.com/e/</code> (from the requested url) and not the actual root, <code>mysite.com/</code>. </p>
  
  <p>Is there something I'm missing here? Is it not possible to use relative srcs for my javascript and css in index.html?</p>
  
  <p>Thanks for helping!</p>