A segment from this house rabbit society article:
Prevention
Ridding the environment of flies, by means of chemical insecticides may damage the environment, animals, and people along with the flies. Fly traps catch many flies but not all. Repellents may work temporarily, but one must remember to use them repeatedly. Screens on doors and windows reduce the number of flies that get into the house, but some slip through.
At best we can only reduce, but we can’t eliminate flies from the environment. So we turn a watchful eye to the potential victim.
To make the environment on the rabbit as hostile as possible to egg-laying flies, here are two rules:
Keep it dry!. Don’t dip the rabbit’s rear end into water. (You resort to that only after an infestation but not for prevention.) Instead, use a “spot cleanser” for softening, loosening and removing feces stuck to the hindquarters.
Keep it short-even shaved. Clear any area that tends to stay damp. This will also enable you to get to these areas with your cleaning solutions.
External cleansers: Nolvasan Otic solution, available through your veterinarian or veterinarian supply catalog, is used for loosening ear wax but also works well on the hindquarters. Its antibacterial/ anti-fungal agents soften caked-on feces and/or yeast.
A good cleaner from your pet supply store is Nolvadent, which you might already be using to brush your dog’s teeth.
If your bunny’s problem is urine-soaked fur rather than fecal material, then ChlorhexiDerm Flush (also non-prescription) may be your best choice, since it has a drying agent.
Some rabbits are more prone to it, especially outdoor rabbits or rabbits who can’t clean themselves properly.