format ref url properly