Ways to prevent UTI's

Katie • Stay at home mommy as of 6/30/16!!!
So I'm 33 two weeks ago I came down with a UTI and my first one ever. Yeah if you've ever had one they're not fun at all. Who knows where I got it but most likely I got it from intercourse and not properly cleaning up after the fun! My doctor mentioned how I caught it early but still they put me on my antibiotics and last week I had to go on another anabiotic's because I s wasn't fully cleared up. 
 Soooo my question to you guys is how and what are ways I can prevent my body from catching another one?  I have heard many different things about laying in bed after having sex for 10 minutes with your legs up and then once you do that go to the bathroom and vigorously wipe up the sperm and or pee to help clean up and prevent another. 
What are your tricks to help avoid catching another one from intercourse? My period has ended it is time to start BDing!!!