redbird icon indicating copy to clipboard operation
redbird copied to clipboard

Absolute paths are broken

Open Bowserinator opened this issue 8 years ago • 2 comments

Suppose I had a server running on port 50 serving the file index.html: <a href="/something.html">Broken link</a>

In redbird I setup var proxy = require('redbird')({port: 80, xfwd: false}); proxy.register("example.com/test", "127.0.0.1:50"); When I access example.com/test, it redirects correctly to index.html. But when you click on the link it directs you to example.com/something.html, not example.com/test/something.html

Bowserinator avatar Sep 20 '17 22:09 Bowserinator

There's no issue here. Your link's href starts with a slash, so it's relative to the root of the domain.

justlep avatar Oct 10 '17 11:10 justlep

It is a mixed problem of redbird and the browser. Redbird should be able to set up a trailing slash, otherwise the browser interprets it as a file, not a folder.

Thus, this also makes loading additional resources impossible. E.g.: example.com/test should redirect to example.com/test/ so path resolving is done correctly.

MartinMuzatko avatar Aug 07 '18 14:08 MartinMuzatko