Better url base detection