This is a complicated question to ask:
I was implented a REST Application in 2 parts:
In the client, my Backbone App uses the backbone router api, for example i have this uri:
"http://localhost:8000/myApp/#/resource1/attribute"
This is a Backbone route, like i perhaps, when i put this url in the web browser, the browser sends to the server: "http://localhost:8000/myApp/" but the second part (the fragment) it's for execute when he download the app from the server, i suppose it's correct...
Well, because i'm implementing my own web server with Restlet, i want the next scenario:
To implement that point, i implemented a Redirection on my restlet server, when a incoming request to the url: "http://localhost:8000/myApp/resource1/attribute" i redirect it to this url: "http://localhost:8000/myApp/#/resource1/attribute/" with a 307 (Temporary redirection) and set the url in the "Location" header.
All is correct at this moment, the browser receive the response with the redirect, and the browser call to the server with this url again. I see in the url bar the redirect url. But, the routing doesn't work, i receive the webApp, but it's look like the browser doesn't execute the fragment of the uri.
Maybe, anyone can show me the light?
The problem was with the response url in the redirect. The last '/' must be omitted, because the routing in backbone.router is: "resource1/:variable": "variableFunction"
The fragment executed on the browser works correctly now.