Better url parsing to support ios urls.