Fixing absolute URLs for empty urls

Empty urls are now handled properly as well as relative "./" or "." urls

@tractorcow

re #3323 and #3345