Changed server_url detection to simply remove the end of the string.