load resources with absolute paths.

Previously we used relative routes, everything worked until we tried to load
a subpage ( /media/edit ), the browser asked for /media/js/main.js and we gave
it the full index.