You will have to eliminate their food source in your home (such as overripe or rotting fruit, unrinsed fruit cans, or even fruit you've left out to ripen). Once you are sure they have nowhere else to feed, you can set small dishes of cider vinegar with just a drop of dish soap in them on the counter. The fruit flies will land on the vinegar to feed, but the soap will have broken the surface tension and they will fall in and drown. It's kind of gross, you'll end up with little dishes of vinegar with lots of dead fruit flies; but after a few days they'll be gone. Refresh the dishes every day or two. You can run it down the drain, or flush it.
Put some small pieces of fruit in a bowl and over it with plastic wrap. Poke a couple small holes in the plastic wrap with a toothpick or something similar. the fruit flies are then attracted to this, and can get in, but they can't figure out how to get out! Works wonderfully all summer long. You may, of course, need to replace/replenish the fruit, but this helped me so very much last year!
I never had luck with the vinegar water with dish detergent. Sticky hang strips can work VERY well. Sticky hang tape can be gotten at hardware stores, or most places that sell bug spray. They are very cheap too. You can get 4-5 for something like $2-$3. You can also get them on line.
To get rid of fruit flies just put fill a glass with water and then put a few spoon fulls of vinegar. Leave the cup overnight and all of the fruit flies will have landed in the vinegar. Works like a charm.
Add your voice to the conversation. Click here to answer this question.