I totally agree with the previous response regarding saddle, saddle position, clean shorts, etc. Consider saddles with cutouts, as well. Wash your shorts in hot water to make sure they are really, really clean (cold water won't kill the bacteria that likes to live there). Avoid fabric softeners and soaps with perfumes--particularly with cycling gear as they can cause irritations that provide a weak spot for bacteria to exploit.
But, alas, some of us will always be more susceptible to bladder infections than others, no matter what we do. If you aren't already a cranberry juice addict, consider that with every bike ride should be 8 oz of cranberry juice. Cranberry juice has been shown to set up an environment in the bladder that prevents bacteria from hanging around and causing the dreaded bladder infection.