How do you get a bacterial infection of the vagina?

A number of ways. Most common stds are bacterial, so sexual transmission is one way; alternatively, you can have fecal contamination if fecal matter made its way to the vaginal vault. Anything that flushes external material into the vagina, such as douching, could lead to a bacterial infection as well.
Bacterial vaginitis. This may be caused by a variety of physiologic changes including the acid/base balance in the vagina, the various types of "normal" bacterial flora present. This can be sexually transmitted, in the sense that organisms not previously present are introduced, but this is not a common etiology except with gonorrhea.

Related Questions

Is it possible to get a bacterial infection of the vagina from old razor?

Absolutely. Anytime you shave you cause micro-cuts in the skin (sometimes large cuts). This breaks down your bodies first defense against infection. Additionally the razor I am sure had bacteria on it which you may have introduced directly into the skin. Pls see you doc. Hope this helps. Read more...

Is changing positions during sex a way to get a bacterial infection through the vagina.

Yes. Changing position can cause an infection if the surrounding skin/tissue is not clean. Read more...
No. Exposure is exposure. The only way to worsen it would be to move from anal to vaginal sex without properly cleaning. Read more...
Only after anal sex. Most common cause of getting a bacterial urinary infection is bacteria from around the urethral or vaginal opening moving up the urthra by the pumping action within vagina situated just under the ur increaseethra. Uti can be avoided by emptying bladder after sex. Changing positions during vaginal sex does not increase vaginal infections or utis. Read more...

If I had open wounds from shaving on my vagina, is it possible to get a bacterial infection through your vagina during sexual intercourse.

Yes. Always possible to be infected through unprotected sex, but superficial open shaving cuts are unlikely to be the target, and these cuts are generally on the surface of your outer labia and not inside your vaginal barrel. Would be more concerned about sexually transmitted diseases. Read more...
Yes. Bacteria can enter any type of open cut or wound, if you are worried see your gyn for an exam and cultures and antibiotics can be started if necessary. Read more...