I have pain and discomfort that comes and go in the right iliac area and up to lower rib cage for more than 6 months what could it be?

Could be a number of. Possibilities, like a chronic appenditis, a kidney stone caught in the ureter, a pelvic problem, enlarged lymph nodes in the abdomen in that area. See your pcp and probably a general surgeon for proper evaluation.