Preventive measures include minimizing the number of vaginal examinations during labor, especially after the rupture of membranes, maintaining sterile techniques during obstetric procedures, and screening for and treating bacterial infections during pregnancy. In cases of prolonged rupture of membranes, prophylactic antibiotics may be administered to reduce the risk of infection.