Remove trailing ? from urls without parameters