documentcloud/backbone — pull request #2538 by suprMax (2013-05-15 11:18:18+00:00)
Title: noRedirect option for Backbone.History

Hi!

I'm building a mobile web-app based on backbone (obviously) and found myself in a position where I want to have different states within one URL. I tried using hash for that since I use pushState for normal navigation.

The problem with that is when I hit refresh Backbone tries to be too smart for its own good and redirects me from for example http://localhost:3000/#datepicker to http://localhost:3000/datepicker which just shows a 404 error.

My attempt to solve this issue it is to introduce new option for Backbone.History that just stops that redirect behavior to occur, if you don't care for non-pushState browsers altogether (and I don't hence all mobile browsers support it).

If there's another way to solve this issue without creating a mess of extra routes in the router please let me know :) I might've missed something.