title: HTML5 pushState with Backbone.js router not working on specific server but working on others
body: <p>Been pulling my hair out over a certain issue. I can't seem to find out why my pushState router is not working on our development server while it works perfectly on 2 other real servers (staging and client's live domain) and it also works for my local MAMP server.</p>
  
  <p>Here's my router:</p>
  
  <pre><code>    jQuery(function(){
          // define routes
          var Router = Backbone.Router.extend({
             routes: {
                  '': 'chrono',
                  ':number': 'chrono',
                  ':number/plus': 'chrono'
             },
  
            // load views
            initialize: function() {
                Backbone.history.start({
                    pushState: true,
                    hashChange: false     // use html5 pushState with hashChange set to false
                                          // to handle navigation of hash anchors
              });
            },
  
            chrono: function(number) {
                  url = window.location.hash.split("/");
  
                  this.reset();
                  this.content = new chronoView();
  
                  if(number == undefined){
                      number = 0;
                  }
                  if(url[1]=="plus") {
                      this.content.showMiddleBox();
                      jQuery('#overlay2').show();
                  }
            },
  
            reset: function() {
                  if (this.content != undefined){
                      this.content.hide();
                   }
            }
        });
  
        var Router = new Router;
      });
  </code></pre>
  
  <p>My <code>.htaccess</code> file on the non-working server does have quite a few engine re-write rules already, and the file itself is 200+ lines but here's what I deem to be the relevant parts:</p>
  
  <pre><code>    # Block access to "hidden" directories whose names begin with a period. This
      # includes directories used by version control systems such as Subversion or Git.
      &lt;IfModule mod_rewrite.c&gt;
        RewriteCond %{SCRIPT_FILENAME} -d
        RewriteCond %{SCRIPT_FILENAME} -f
        RewriteRule "(^|/)\." - [F]
      &lt;/IfModule&gt;
  
      &lt;IfModule !mod_rewrite.c&gt;
          # If we don't have mod_rewrite installed, all 404's
          # can be sent to index.php, and everything works as normal.
          # Submitted by: ElliotHaughin
  
          ErrorDocument 404 index.php
      &lt;/IfModule&gt;
  
      # URL and hash rewrite for backbone
      # Used for HTML 5 pushState support *NOT WORKING*
      &lt;ifModule mod_rewrite.c&gt;
          RewriteEngine On
          RewriteCond %{REQUEST_FILENAME} !-f
          RewriteCond %{REQUEST_FILENAME} !-d
          RewriteCond %{REQUEST_URI} !index
          RewriteRule (.*) index.html [L]
      &lt;/ifModule&gt;
  </code></pre>
  
  <p>/* EDIT */</p>
  
  <p>After comparing the <code>.htaccess</code> file of the non-working server against the working server<code>.htaccess</code> I've not had any success, as both files were essentially the same except for some accounting for subfolder paths. I.e.:</p>
  
  <p>Working server: <code>RewriteRule ^(.*)$ index.php?/$1 [L]</code>
  Non-working server: <code>RewriteRule ^(.*)$ dj24/index.php?/$1 [L]</code></p>
  
  <p>And that's the only difference between the two files, but this makes sense because the client's version (working .htaccess) is hosted on subdomain with no subfolder, i.e. <code>http://subdomain.ClientsDomain.com/</code> whereas our development server version hosts the project on a subfolder path to a subdomain, i.e. <code>http://dev.Our_Domain.com/OurApplication</code></p>
  
  <p>I'm starting to believe it's the subdomain + subfolder combo that's causing the issue. Any help with this would be appreciated. Thanks!</p>