You probably have a resistant urinary tract infection
. You should get a urine culture and sensitivity test done and find out which antibiotics the infection is sensitive to. Also since you have the infection on and off for 8 months you should consult a nephrologist
and get an ultrasound
done to rule out pyelonephritis
, in which case you may need a more extensive course of antibiotics. Cranberry juice is a useful home remedy to relieve the pain but not a treatment.
Hope you get well soon