Rifaximin is used to treat diarrhea caused by the common bacteria known as E.coli ("traveler's diarrhea"). Rifaximin should not be used if you have a fever or bloody diarrhea. This medication stays in the digestive system and is not absorbed into the blood. It works by stopping the growth of bacteria.