I'm trying to implement the { pushState : true }
but it works only for the base route, not with the other that continue to give me error 404.
In Chrome, If I access:
http://example.app/ - OK the console message is displayed
http://example.app/show - error 404 is returned
My route is
var AppRouter = Backbone.Router.extend({
routes: {
'': 'index',
'show': 'show'
},
index: function() {
console.log('This is the index page');
},
show: function() {
console.log('This is the show page');
}
});
new AppRouter;
Backbone.history.start({pushState: true});
My .htaccess
<ifModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !index
RewriteRule (.*) index.html [L]
</ifModule>
What I'm missing or I'm doing wrong?