Regular house flies like litter boxes. FRUIT FLIES do not breed in poop, they breed in liquids or old food. They like sweet things. Old fruit, even a drop of tea / soda / juice left in a glass, pasta sauce, etc that sort of stuff in the garbage can or the garbage disposal or about the house. Fruit flies breed unbelievably fast, so leaving dirty dishes in the sink to do at the end of the day is just giving them a breeding ground. Once they are in the house, you have to be OCD about cleaning until they go away. And do NOT keep ANY fruit outside the fridge – bananas in a fruit basket is their favorite here, so I have to just not buy bananas til they go away. Another big favorite of fruit flies is alcohol, so any beer cans or wine bottles in the trash will attract them and let them breed as well.If you throw ANYTHING that would be a food source into the garbage, wrap it up in a wal-mart or grocery plastic bag first and tie it shut. They will crawl into the cracks of your garbage can lid and breed in there.
But… to catch the ones that are in the house now, you can buy a fruit fly trap in the store which is basically a small plastic thing with small slits in it that they can crawl down into and not get out of. You can make one yourself from a soda bottle and saran wrap, but I find the store bought ones work better – the home made ones they never went into for me, the store bought ones got rid of them in a few days. If you try the home made ones, you should use something sweet like fruit juice or apple vinegar or bananas, something they’ll go for. Mix a tiny bit of dish detergent into the liquid. The reason for the dish detergent is they can actually stand on liquid and drink it without getting caught in it. The dish detergent makes them fall in.
http://www.homedepot.com/p/Terro-Fruit-Fly-Trap-2500/203225201?cm_mmc=shopping-_-googleads-_-pla-_-203225201&skwcid&kwd=&ci_sku=203225201&ci_kw=&ci_gpa=pla&ci_src=17588969 <– that is the best fruit fly trap I know of. Key is though to never leave any food source available for more than an hour. Meaning, use a dish and wash it. Drink your soda and rinse the cup. They come into our house during summer and we just have to be on top of removing food sources (they are around cause of the farms nearby and they come in with open doors or windows), they have never, ever been interested in our rabbits litter box.