Encode query in URL