I just changed my routing from query-strings to a kind of restful API.
Before:
http://www.server.de/?item=1234
After:
http://www.server.de/item/1234
I route these requests with Express as follows:
app.get('/item/:itemID', function(req, res){
var itemID = req.param('itemID');
res.sendfile(__dirname + '/public/application.html');
});
Every file, that application.html wants load (like styles, images, javascripts ...) is saved in a subdirectory assets/... After the routing-change, they are being searched in the "virtual" directory item/assets/... which of course returns 404 (until I change the paths in the .hmtl-file).
How can I route such URLs without changing the whole context of paths?
Edit:
Watch Tim Coopers comment. Redefining the paths in the .html-file as absolute did the trick.