Anytime I have a dog that has a UTI, I add extra water to their food. I also give Cranberry pills. I sometimes give Vitamin C but that is based on the ph level of the urine and the recommendation of the vet. My dogs rarely have crystals but perhaps I catch the UTIs early.
It seems like rescues I get from shelters almost always have UTIs. I think they get it from either holding it too long because they do not want to get their kennel dirty or because they eat dry food and drink water separately.