Derive ports in relative paths

This patch was useful to me in my use of absolute-url-deriver.