Hi and welcome to the forum! I am glad that I can help you.
You want to know the cause of the symptoms that you experience.
Certain individuals are more reactive to different substances and are prone to allergies. All medications including antibiotics may cause allergies. The allergy is characterized by a rash or urtica.
According to the data that you described, it is likely that the rash is due to an allergy to the combination of trimetoprim and sulfomethoxazole. You may consider stopping the treatment with this medication and avoid any additional usage of the same. Have a bacterial culture with an antibiogram taken from a urine sample. You may also need to take antibiotics according to the antibiogram results, but avoid the combination of trimetoprim and sulfometoxazole.
Please keep in mind that I provide medical information only. I am not able to diagnose medical conditions online. Please contact your doctor for further advice and information about diagnosis and treatment options.