I'm glad that you recognize the difference between a yeast infection and a UTI because many people mistakenly confuse them to be the same thing and even take medicine made for a yeast infection for their UTI only to realize that they are NOT getting better at all. A Urinary Tract Infection is mainly from bacteria, and a yeast infection is from yeast.
You pretty much linked the yeast infection to the UTI as a cause and effect. Because you got a UTI therefore you got a yeast infection. UTI's can lead to a yeast infection, but for different reasons than you think. The yeast infection you develop after or during a UTI isn’t usually from the urinary tract infection itself. It’s often from the use of antibiotics to treat the UTI, which kill all of the good and bad bacteria in your body. When this happens, the yeast organism can thrive. Many women get vaginal yeast infections immediately after a UTI, but some people develop other complications over time, especially if antibiotic use is chronic. As a matter of fact, it’s a little bit of a catch-22 situation. If you have a yeast infection, you may get chronic urinary tract infections as a result. The UTI is treated with more antibiotics, which makes your yeast overgrowth worse, which makes your UTI harder to treat!
Really the best solution is to find out what is the reason you keep getting UTI's and stopping that. It might require a change in your bathroom habits, your fluid intake, your contraceptives and sexual habits. There is usually a reason, and you may need to speak to your physician, but having a UTI is quite painful always having to go to the bathroom nonstop, and nobody wants to experience it. Always ensure you drink plenty of fluids, and are cleaning out your urinary tract. According to the NIH, probiotics also help against UTI's.