Fruit fly control begins with proper identification. These pesky little buggers measure 1/10 to 1/8 of an inch, are tan to brown in color with darker, often striped abdomens, and have transparent wings and distinctive red eyes.
Fruit Fly
Fruit Fly Larvae
Drain Fly

Drosophila melanogaster (fruit fly or vinegar fly) is one of the most prevalent house pests in the country. While the northern half of the U.S. only has to deal with them for half the year, southerners never get a break. Considering that fruit flies can burn through their life cycles in eight to ten days and poop out five hundred to two thousand eggs along the way, they could certainly use one. Fruit flies don't actually eat ripe/rotten/fermenting fruit and vegetables; it's the yeast they're attracted to, which explains their love of beer, wine, and vinegar. The worst thing about fruit flies is that they've been known to breed in fecal matter, making them potential disease vectors.
Remove primary food sources. There are no surprises here, folks, but diligence is key. Always store fruits and vegetables in the fridge or an airtight container. Check the cupboards, too—wet grains or pastas are prime breeding grounds; dispose of them and get some air-tight containers for the new stuff. If you compost, don't leave the scraps indoors. If you throw your scraps away, take the garbage out immediately. Speaking of garbage, remove the liner and clean that trash bin out. Fruit flies will breed in the muck that builds up on the bottom. If you have an indoor recycle bin, clean that, too. Finally, don't forget to check your bag of potatoes. One bad spud is all it takes.
Remove secondary food sources. After you take away their favorite breeding sites, fruit flies will be forced to look elsewhere and venture further. Start by giving your drains and garbage disposal a thorough cleaning. Next, move to the dishwasher. Clean all spilled food and liquid out of it and leave it empty until the fruit flies are gone. Do dishes every day by hand and don't let the dirty rag sit. Clean under appliances (microwave, oven, fridge), and if you have kids, check their rooms for dirty dishes and empty soda cans. Rinse out all recycling. If you're diligent about keeping the joint super clean for at least three to four weeks, you may not need to go further than these first two steps.
Set out some fruit fly traps. For heavy fruit fly infestations, a couple of well-placed fruit fly traps can quickly and significantly reduce the population. Place traps in areas of highest fruit fly concentration. Look for traps like the Vector Fruit Fly Trap, Natural Catch Fruit Fly Trap, Springstar Kitchen Fruit Fly Trap, Trapple Natural Fruit Fly Trap, or the Banana Scent Fruit Fly Trap. You can also get an electric fruit fly trap, like the Fly Web Fly Trap, that plugs into the wall and lures fruit flies in with UV light. Once inside, flies stick to an easily replaceable glue board. Remember, these traps only help to speed the process of getting rid of fruit flies. You'll still need to clean house.
Kill fruit flies with spray. Because food is so often involved, killing fruit flies with sprays is ill advised. If, however, fruit flies have invaded areas like under the kitchen sink or around the garbage, blasting 'em with some insecticidal spray is a quick and efficient way to knock back the hoards. As with traps, spray alone will not get rid of fruit flies completely. You'll still need to remove their food sources. Since you'll be spraying in the house, I advise you to use a pyrethrin spray. They're extremely toxic to fruit flies but surprisingly nontoxic to humans (although cats often are allergic). Look for MotherEarth 2% Py Contact Aerosol, 565 Plus XLO, or Safer Brand Flying Insect Killer.
Exclude fruit flies from your home. Start by making sure window screens fit snugly. Next check for and patch any holes or cuts in window and door screens. If you have large mesh screens, you may need to consider installing new, smaller-meshed screens. Next, look for gaps around window and door frames. If you find any, caulk them. Finally, look around all electrical components (outlets, lights, etc.), cables, wires, and plumbing entering the house to make sure there are no gaps. If there are, caulk them. Remember, even if your house is air tight and adult fruit flies can't get in on their own, fruit fly larvae may still hitch a ride in on "fresh" produce.
Your chances of needing to get rid of fruit flies indoors will be greatly reduced if you take the necessary precautions outdoors. Fewer fruit flies in the overall vicinity equals fewer fruit flies all up in your crib.

Vinegar fruit fly trap. Grab a bowl, put a quarter cup of apple cider vinegar in it, cover the bowl with plastic wrap, secure the plastic wrap with a rubber band, and poke a bunch of holes in the top of the plastic wrap with a toothpick. Fruit flies go in and can't get out. Take the trap outside periodically to release the live ones and dump the dead ones. Oh, and a chunk of banana makes a nice addition to the vinegar.

Zipper bag trap. Speaking of bananas, grab a zipper bag, eat a banana, put the banana peel in the zipper bag, and close all but the last inch of the zipper bag. Use the stem of the banana peel to prop the last inch open. Place the trap near infested areas and let the fun begin. When the bag has a healthy number of dead-to-be flies in it, zip up the last inch, and either dispose of the bag or take it outside to release the flies; then, reset the trap.

Soda bottle trap. This is the last homemade fruit fly trap I'll mention. Grab an empty soda bottle (two-liter, twenty-ounce, whatever) and cut the top off at the point where the neck begins to narrow. Pour an inch of apple cider vinegar, balsamic vinegar, red wine vinegar, beer, wine, or juice in the bottom and add a chunk of fruit. Next, invert the neck of the bottle (with the lid off) and staple it on. Fruit flies fly in and are too stupid to get back out.