auto detection of base url