You’re more likely to get prostatitis if you have had a recent urinary tract infection (UTI), a prostate biopsy, asexually transmitted infection (STI), HIV or AIDS.