What symptoms does your rabbit have? Peeing everywhere? Making small pees? Sitting in a corner? Flopping really long and changing position? Soaked bottom? Squeaking as he pees or tries to pee? Something else? Is he able to pass urine? Is he eating, drinking, pooping?
I've dealt with several urinary tract infections (and read quite a lot about everything around it), and usually Ditrim or Baytril helps within a few hours or a day. A simple dipstick or lab test from the urine can show the presence of blood which usually means infection.
If one antibiotic does not help in a reasonable time at all, another could be tried.
You could try getting him to pee in an empty litter box and collect a sample with a clean syringe. It won't be good enough for culture but it works for dipstick and some lab tests.
If there's a bladder stone involved, that can also be the reason for microscopic or visible blood. An X-ray or ultrasound (both which can be done awake with some rabbits) would show the stone(s). Kidneys and their size can also be checked with ultrasound. A stone could be in the kidneys, in the bladder, or stuck somewhere coming out. If it's blocking the flow of urine, then an operation would need to be done and soon. But you really need a proper diagnosis to know what is going on. I'm not knowledgeable of all the ways to deal with a stone, however, sorry.
What I've found too is that sometimes a tummy ache or other illness can cause very similar symptoms to an UTI: sitting hunched, even making small pees around in unusual places because of pain. And different bunnies show symptoms in different ways. But you mention pain when urinating so I am assuming the bunny is literally wheezing or squeaking? I've seen that maybe once out of all the times my boy had an UTI going on because luckily we usually caught it early.
Hopefully this helps at all. Give us more info if you can. I hope it all works out!