calculate baseurl