Mix the flour with the dry yeast in a mixing bowl. Add the melted butter, salt, chopped rosemary, onions and lukewarm water. Knead with the kneading hook of the electric mixer to form an elastic dough. Cover and let rest in a warm place (such as the oven at 50°C, approximately 120°F) for about 30 minutes.
Butter your loaf pan and line with foil. Knead the dough on a floured work surface and shape into a loaf. Sprinkle with flour and let rise again. Bake in the preheated oven at 180°C (approximately 350°F) for 1 hour. Remove and let cool completely.