Flies are attracted to urine, feces, and food. Therefore, make sure the rabbit's bedding is clean and dry at all times by spot cleaning daily and changing all of the bedding once a week. Additionally, various fly repellent products are available that you can hang around the cage to repel flies.