Base url function, strip index from right of url