I used to have lots of bladder infections. It's been over 8 years now since I had one. You should see your Dr. and see what they recommend. This is what I did:
1) Never hold it in. Always pee as soon as the urge hits. Also make sure to completely empty. You can always sqeeze out just a little more.
2) I started drinking cranberry juice, but since my diabetes diagnosis (type 2) I switched to cranberry pills since the juice is too high in sugar.
3) Always pee soon after sex to flush any bacteria.
4) Wipe front to back (again to prevent bacteria).
Hope this helps. Sorry if this was too graphic for anyone LOL.
Lisa