I used to get a lot of bladder infections too. My doctor told me to help prevent these always wipe from front to back. Sometimes i use a little toilet paper to wipe my front area and a different wad to wipe my back area. This prevents any UTI causing bacteria from reaching your urethra. Also, pee after EVERY sexual act, whether it be sex with your bf or masturbation. ALWAYS PEE!! I never felt like I had to pee after but I started making myself go to the bathroom and sure enough, pee would come out. Believe it or not, this will probably cut your UTIs in half. Drink plenty of water and keep your undies clean.
If you do all this and you still have a crazy amount of UTIs you could have other problems going on with your urethra which you will have to see your doctor about. My obgyn said that frequent and reccurrent UTIs are not normal and that if you do all the things I've mentioned here and still have them it could mean something more serious is wrong. Good luck!