localize base url and add file: -> http: logic to allow functioning with file-based urls