title: Why is require.js ignoring config baseUrl and paths
body: <p>I am having a problem where almost-identical require.js config calls appear to work differently, in one case failing to set <code>baseUrl</code> and <code>path</code>.</p>
  
  <p><strong>Folder structure</strong></p>
  
  <pre><code> - /js
   - - app/
   - - libs/
   - - - hogan.js
   - - - backbone
   - - - - backbone.js
   - - - - etc.
   - - - boostrap
   - - - jquery
   - - - - jquery.js
   - - - - etc.
   - - - require
   - - - - require.js
   - - - - etc.
   - - templates/
   - - require.config.js
  </code></pre>
  
  <p><strong>Script tag</strong></p>
  
  <p><code>&lt;script data-main="/resources/js/require.config" src="/resources/js/libs/require/require.js"&gt;&lt;/script&gt;</code></p>
  
  <p><strong>Require configuration</strong></p>
  
  <pre><code>require.config(
      {
          baseUrl: "/resources/js/libs",
          shim: {
              "underscore": {
                  exports: "_"
              },
              "backbone": {
                  deps: [
                      "json2",
                      "underscore",
                      "jquery"
                  ],
                  exports: "Backbone"
              }
          },
          paths: {
              "app": "/resources/js/app",
              "backbone": "backbone/backbone",
              "jquery": "jquery/jquery",
              "templates": "/resources/js/templates",
              "templateEngine": "hogan"
          }
      }
  );
  
  require(
      [
          "app/router"
      ],
      function( AppRouter ){
          AppRouter.execute();
      } 
  );
  </code></pre>
  
  <p>In both cases, a script tag gets appended that shows the full contents of require.config.js, starting with:</p>
  
  <p><code>&lt;script type="text/javascript" charset="utf-8" data-requirecontext="_" data-requiremodule="require.config" src="/resources/js/require.config.js"&gt;</code></p>
  
  <p><strong>Definition in app/router</strong></p>
  
  <pre><code>define(
      [
          'backbone',
          'templateEngine'
      ],
  // etc
  );
  </code></pre>
  
  <p>However where the problem occurs, app/router is never loaded, only the following (no 404, nothing):</p>
  
  <pre><code>GET require.js 200 OK 180ms     
  GET require.config.js 200 OK 69ms
  </code></pre>
  
  <p>If I enter <code>require(["app/router"]);</code> into the Firebug console I get the following:</p>
  
  <pre><code>"NetworkError: 404 Not Found - /resources/js/backbone.js
  "NetworkError: 404 Not Found - /resources/js/templateEngine.js"
  </code></pre>
  
  <p>When what I expect to see is:</p>
  
  <ul>
  <li>/resources/js/libs/backbone/backbone.js</li>
  <li>/resources/js/libs/hogan.js</li>
  </ul>
  
  <p><strong>Solutions attempted</strong></p>
  
  <ul>
  <li>I have attempted to use various combinations of relative and absolute paths for <code>baseUrl</code> and <code>paths</code>.  For example <code>baseUrl: libs</code>, and <code>paths: { "app" : "../app" }</code>, etc.</li>
  <li>I tried <code>deps</code> and <code>callback</code> instead of using <code>require</code> below <code>config</code>.</li>
  <li>I have added the property <code>context</code>, matching <code>baseUrl</code>.</li>
  <li>I have moved <em>require.config.js</em> into the <em>libs</em> directory (editing <code>baseUrl</code> and <code>paths</code> as appropriate; still get the same issue of ignored config,  only it tries to load <em>/resources/js/libs/backbone.js</em> instead, for example).</li>
  </ul>
  
  <p><strong>Note</strong></p>
  
  <p>This folder structure and config file does work on my localhost, where I remove <em>/resources/</em> from the paths as shown above.  Instead all-relative paths (none starting with /) are used for <code>baseUrl</code> and <code>paths</code>.  But on the actual server that is not an option.</p>