Remove url fragments and trailing slashes from baseUrl if any